/ Check-in [3af283f4]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add flags values to the Mem structure to accomodate BLOBs and to show the representation of strings. (CVS 1341)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3af283f483f75795d5b03dc8fd886aaf326d50b7
User & Date: drh 2004-05-10 12:07:11
Context
2004-05-10
16:18
The btree.c module now passes all the historical regression tests. New tests for new functionality still need to be added. (CVS 1342) check-in: 433ae0d3 user: drh tags: trunk
12:07
Add flags values to the Mem structure to accomodate BLOBs and to show the representation of strings. (CVS 1341) check-in: 3af283f4 user: drh tags: trunk
10:37
Change the names of external symbols from sqlite_XXX to sqlite3_XXX. (CVS 1340) check-in: ac46bd68 user: danielk1977 tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/vdbeInt.h.

110
111
112
113
114
115
116
117
118
119
120
121
122
123









124
125
126
127
128






129
130
131
132
133
134
135
136
137
138
139
...
302
303
304
305
306
307
308
309
310
311
** is an instance of the following structure. 
*/
struct Mem {
  int i;              /* Integer value */
  int n;              /* Number of characters in string value, including '\0' */
  int flags;          /* Some combination of MEM_Null, MEM_Str, MEM_Dyn, etc. */
  double r;           /* Real value */
  char *z;            /* String value */
  char zShort[NBFS];  /* Space for short strings */
};
typedef struct Mem Mem;

/*
** Allowed values for Mem.flags









*/
#define MEM_Null      0x0001   /* Value is NULL */
#define MEM_Str       0x0002   /* Value is a string */
#define MEM_Int       0x0004   /* Value is an integer */
#define MEM_Real      0x0008   /* Value is a real number */






#define MEM_Dyn       0x0010   /* Need to call sqliteFree() on Mem.z */
#define MEM_Static    0x0020   /* Mem.z points to a static string */
#define MEM_Ephem     0x0040   /* Mem.z points to an ephemeral string */
#define MEM_Short     0x0080   /* Mem.z points to Mem.zShort */

/* The following MEM_ value appears only in AggElem.aMem.s.flag fields.
** It indicates that the corresponding AggElem.aMem.z points to a
** aggregate function context that needs to be finalized.
*/
#define MEM_AggCtx    0x0100   /* Mem.z points to an agg function context */

................................................................................
void sqlite3VdbePrintOp(FILE*, int, Op*);
#endif
int sqlite3VdbeSerialize(const Mem *, unsigned char *);
int sqlite3VdbeSerialLen(const Mem *);
int sqlite3VdbeDeserialize(Mem *, const unsigned char *);

int sqlite2BtreeKeyCompare(BtCursor *, const void *, int, int, int *);










|





|
>
>
>
>
>
>
>
>
>





>
>
>
>
>
>
|
|
|
|







 







<
<
<
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
...
317
318
319
320
321
322
323



** is an instance of the following structure. 
*/
struct Mem {
  int i;              /* Integer value */
  int n;              /* Number of characters in string value, including '\0' */
  int flags;          /* Some combination of MEM_Null, MEM_Str, MEM_Dyn, etc. */
  double r;           /* Real value */
  char *z;            /* String or BLOB value */
  char zShort[NBFS];  /* Space for short strings */
};
typedef struct Mem Mem;

/*
** Allowed values for Mem.flags.
**
** The first 5 values determine the data type(s).  Null and Blob must
** occur alone.  But Str, Int, and Real can occur together.
**
** The next 3 utf entries determine the text representation for strings.
** These values are only meaningful if the type is Str.
**
** The last 4 values specify what kind of memory Mem.z points to.
** These valus are only meaningful if the Str or Blob types are used.
*/
#define MEM_Null      0x0001   /* Value is NULL */
#define MEM_Str       0x0002   /* Value is a string */
#define MEM_Int       0x0004   /* Value is an integer */
#define MEM_Real      0x0008   /* Value is a real number */
#define MEM_Blob      0x0010   /* Value is a BLOB */

#define MEM_Utf8      0x0020   /* String uses UTF-8 encoding */
#define MEM_Utf16be   0x0040   /* String uses UTF-16 big-endian */
#define MEM_Utf16le   0x0080   /* String uses UTF-16 little-endian */

#define MEM_Dyn       0x0100   /* Need to call sqliteFree() on Mem.z */
#define MEM_Static    0x0200   /* Mem.z points to a static string */
#define MEM_Ephem     0x0400   /* Mem.z points to an ephemeral string */
#define MEM_Short     0x0800   /* Mem.z points to Mem.zShort */

/* The following MEM_ value appears only in AggElem.aMem.s.flag fields.
** It indicates that the corresponding AggElem.aMem.z points to a
** aggregate function context that needs to be finalized.
*/
#define MEM_AggCtx    0x0100   /* Mem.z points to an agg function context */

................................................................................
void sqlite3VdbePrintOp(FILE*, int, Op*);
#endif
int sqlite3VdbeSerialize(const Mem *, unsigned char *);
int sqlite3VdbeSerialLen(const Mem *);
int sqlite3VdbeDeserialize(Mem *, const unsigned char *);

int sqlite2BtreeKeyCompare(BtCursor *, const void *, int, int, int *);