annotate sqlite/vdbeInt.h @ 1645:67f6cfc251de trunk

[svn] - new InterfacePlugin API. Like the ContainerPlugin API, it extends the LowlevelPlugin API.
author nenolod
date Thu, 07 Sep 2006 20:41:35 -0700
parents b6b61becdf4e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1434
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
1 /*
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
2 ** 2003 September 6
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
3 **
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
4 ** The author disclaims copyright to this source code. In place of
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
5 ** a legal notice, here is a blessing:
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
6 **
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
7 ** May you do good and not evil.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
8 ** May you find forgiveness for yourself and forgive others.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
9 ** May you share freely, never taking more than you give.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
10 **
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
11 *************************************************************************
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
12 ** This is the header file for information that is private to the
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
13 ** VDBE. This information used to all be at the top of the single
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
14 ** source code file "vdbe.c". When that file became too big (over
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
15 ** 6000 lines long) it was split up into several smaller files and
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
16 ** this header information was factored out.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
17 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
18
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
19 /*
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
20 ** intToKey() and keyToInt() used to transform the rowid. But with
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
21 ** the latest versions of the design they are no-ops.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
22 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
23 #define keyToInt(X) (X)
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
24 #define intToKey(X) (X)
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
25
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
26 /*
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
27 ** The makefile scans the vdbe.c source file and creates the following
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
28 ** array of string constants which are the names of all VDBE opcodes. This
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
29 ** array is defined in a separate source code file named opcode.c which is
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
30 ** automatically generated by the makefile.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
31 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
32 extern char *sqlite3OpcodeNames[];
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
33
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
34 /*
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
35 ** SQL is translated into a sequence of instructions to be
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
36 ** executed by a virtual machine. Each instruction is an instance
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
37 ** of the following structure.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
38 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
39 typedef struct VdbeOp Op;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
40
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
41 /*
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
42 ** Boolean values
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
43 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
44 typedef unsigned char Bool;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
45
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
46 /*
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
47 ** A cursor is a pointer into a single BTree within a database file.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
48 ** The cursor can seek to a BTree entry with a particular key, or
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
49 ** loop over all entries of the Btree. You can also insert new BTree
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
50 ** entries or retrieve the key or data from the entry that the cursor
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
51 ** is currently pointing to.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
52 **
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
53 ** Every cursor that the virtual machine has open is represented by an
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
54 ** instance of the following structure.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
55 **
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
56 ** If the Cursor.isTriggerRow flag is set it means that this cursor is
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
57 ** really a single row that represents the NEW or OLD pseudo-table of
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
58 ** a row trigger. The data for the row is stored in Cursor.pData and
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
59 ** the rowid is in Cursor.iKey.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
60 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
61 struct Cursor {
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
62 BtCursor *pCursor; /* The cursor structure of the backend */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
63 int iDb; /* Index of cursor database in db->aDb[] (or -1) */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
64 i64 lastRowid; /* Last rowid from a Next or NextIdx operation */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
65 i64 nextRowid; /* Next rowid returned by OP_NewRowid */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
66 Bool zeroed; /* True if zeroed out and ready for reuse */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
67 Bool rowidIsValid; /* True if lastRowid is valid */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
68 Bool atFirst; /* True if pointing to first entry */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
69 Bool useRandomRowid; /* Generate new record numbers semi-randomly */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
70 Bool nullRow; /* True if pointing to a row with no data */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
71 Bool nextRowidValid; /* True if the nextRowid field is valid */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
72 Bool pseudoTable; /* This is a NEW or OLD pseudo-tables of a trigger */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
73 Bool deferredMoveto; /* A call to sqlite3BtreeMoveto() is needed */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
74 Bool isTable; /* True if a table requiring integer keys */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
75 Bool isIndex; /* True if an index containing keys only - no data */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
76 u8 bogusIncrKey; /* Something for pIncrKey to point to if pKeyInfo==0 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
77 i64 movetoTarget; /* Argument to the deferred sqlite3BtreeMoveto() */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
78 Btree *pBt; /* Separate file holding temporary table */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
79 int nData; /* Number of bytes in pData */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
80 char *pData; /* Data for a NEW or OLD pseudo-table */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
81 i64 iKey; /* Key for the NEW or OLD pseudo-table row */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
82 u8 *pIncrKey; /* Pointer to pKeyInfo->incrKey */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
83 KeyInfo *pKeyInfo; /* Info about index keys needed by index cursors */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
84 int nField; /* Number of fields in the header */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
85 i64 seqCount; /* Sequence counter */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
86
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
87 /* Cached information about the header for the data record that the
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
88 ** cursor is currently pointing to. Only valid if cacheValid is true.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
89 ** aRow might point to (ephemeral) data for the current row, or it might
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
90 ** be NULL.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
91 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
92 int cacheStatus; /* Cache is valid if this matches Vdbe.cacheCtr */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
93 int payloadSize; /* Total number of bytes in the record */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
94 u32 *aType; /* Type values for all entries in the record */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
95 u32 *aOffset; /* Cached offsets to the start of each columns data */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
96 u8 *aRow; /* Data for the current row, if all on one page */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
97 };
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
98 typedef struct Cursor Cursor;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
99
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
100 /*
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
101 ** Number of bytes of string storage space available to each stack
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
102 ** layer without having to malloc. NBFS is short for Number of Bytes
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
103 ** For Strings.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
104 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
105 #define NBFS 32
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
106
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
107 /*
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
108 ** A value for Cursor.cacheValid that means the cache is always invalid.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
109 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
110 #define CACHE_STALE 0
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
111
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
112 /*
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
113 ** Internally, the vdbe manipulates nearly all SQL values as Mem
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
114 ** structures. Each Mem struct may cache multiple representations (string,
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
115 ** integer etc.) of the same value. A value (and therefore Mem structure)
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
116 ** has the following properties:
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
117 **
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
118 ** Each value has a manifest type. The manifest type of the value stored
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
119 ** in a Mem struct is returned by the MemType(Mem*) macro. The type is
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
120 ** one of SQLITE_NULL, SQLITE_INTEGER, SQLITE_REAL, SQLITE_TEXT or
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
121 ** SQLITE_BLOB.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
122 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
123 struct Mem {
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
124 i64 i; /* Integer value. Or FuncDef* when flags==MEM_Agg */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
125 double r; /* Real value */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
126 char *z; /* String or BLOB value */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
127 int n; /* Number of characters in string value, including '\0' */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
128 u16 flags; /* Some combination of MEM_Null, MEM_Str, MEM_Dyn, etc. */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
129 u8 type; /* One of MEM_Null, MEM_Str, etc. */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
130 u8 enc; /* TEXT_Utf8, TEXT_Utf16le, or TEXT_Utf16be */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
131 void (*xDel)(void *); /* If not null, call this function to delete Mem.z */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
132 char zShort[NBFS]; /* Space for short strings */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
133 };
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
134 typedef struct Mem Mem;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
135
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
136 /* One or more of the following flags are set to indicate the validOK
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
137 ** representations of the value stored in the Mem struct.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
138 **
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
139 ** If the MEM_Null flag is set, then the value is an SQL NULL value.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
140 ** No other flags may be set in this case.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
141 **
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
142 ** If the MEM_Str flag is set then Mem.z points at a string representation.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
143 ** Usually this is encoded in the same unicode encoding as the main
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
144 ** database (see below for exceptions). If the MEM_Term flag is also
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
145 ** set, then the string is nul terminated. The MEM_Int and MEM_Real
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
146 ** flags may coexist with the MEM_Str flag.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
147 **
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
148 ** Multiple of these values can appear in Mem.flags. But only one
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
149 ** at a time can appear in Mem.type.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
150 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
151 #define MEM_Null 0x0001 /* Value is NULL */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
152 #define MEM_Str 0x0002 /* Value is a string */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
153 #define MEM_Int 0x0004 /* Value is an integer */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
154 #define MEM_Real 0x0008 /* Value is a real number */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
155 #define MEM_Blob 0x0010 /* Value is a BLOB */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
156
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
157 /* Whenever Mem contains a valid string or blob representation, one of
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
158 ** the following flags must be set to determine the memory management
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
159 ** policy for Mem.z. The MEM_Term flag tells us whether or not the
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
160 ** string is \000 or \u0000 terminated
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
161 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
162 #define MEM_Term 0x0020 /* String rep is nul terminated */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
163 #define MEM_Dyn 0x0040 /* Need to call sqliteFree() on Mem.z */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
164 #define MEM_Static 0x0080 /* Mem.z points to a static string */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
165 #define MEM_Ephem 0x0100 /* Mem.z points to an ephemeral string */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
166 #define MEM_Short 0x0200 /* Mem.z points to Mem.zShort */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
167 #define MEM_Agg 0x0400 /* Mem.z points to an agg function context */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
168
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
169
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
170 /* A VdbeFunc is just a FuncDef (defined in sqliteInt.h) that contains
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
171 ** additional information about auxiliary information bound to arguments
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
172 ** of the function. This is used to implement the sqlite3_get_auxdata()
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
173 ** and sqlite3_set_auxdata() APIs. The "auxdata" is some auxiliary data
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
174 ** that can be associated with a constant argument to a function. This
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
175 ** allows functions such as "regexp" to compile their constant regular
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
176 ** expression argument once and reused the compiled code for multiple
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
177 ** invocations.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
178 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
179 struct VdbeFunc {
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
180 FuncDef *pFunc; /* The definition of the function */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
181 int nAux; /* Number of entries allocated for apAux[] */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
182 struct AuxData {
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
183 void *pAux; /* Aux data for the i-th argument */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
184 void (*xDelete)(void *); /* Destructor for the aux data */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
185 } apAux[1]; /* One slot for each function argument */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
186 };
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
187 typedef struct VdbeFunc VdbeFunc;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
188
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
189 /*
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
190 ** The "context" argument for a installable function. A pointer to an
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
191 ** instance of this structure is the first argument to the routines used
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
192 ** implement the SQL functions.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
193 **
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
194 ** There is a typedef for this structure in sqlite.h. So all routines,
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
195 ** even the public interface to SQLite, can use a pointer to this structure.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
196 ** But this file is the only place where the internal details of this
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
197 ** structure are known.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
198 **
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
199 ** This structure is defined inside of vdbeInt.h because it uses substructures
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
200 ** (Mem) which are only defined there.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
201 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
202 struct sqlite3_context {
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
203 FuncDef *pFunc; /* Pointer to function information. MUST BE FIRST */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
204 VdbeFunc *pVdbeFunc; /* Auxilary data, if created. */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
205 Mem s; /* The return value is stored here */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
206 Mem *pMem; /* Memory cell used to store aggregate context */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
207 u8 isError; /* Set to true for an error */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
208 CollSeq *pColl; /* Collating sequence */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
209 };
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
210
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
211 /*
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
212 ** A Set structure is used for quick testing to see if a value
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
213 ** is part of a small set. Sets are used to implement code like
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
214 ** this:
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
215 ** x.y IN ('hi','hoo','hum')
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
216 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
217 typedef struct Set Set;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
218 struct Set {
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
219 Hash hash; /* A set is just a hash table */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
220 HashElem *prev; /* Previously accessed hash elemen */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
221 };
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
222
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
223 /*
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
224 ** A FifoPage structure holds a single page of valves. Pages are arranged
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
225 ** in a list.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
226 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
227 typedef struct FifoPage FifoPage;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
228 struct FifoPage {
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
229 int nSlot; /* Number of entries aSlot[] */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
230 int iWrite; /* Push the next value into this entry in aSlot[] */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
231 int iRead; /* Read the next value from this entry in aSlot[] */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
232 FifoPage *pNext; /* Next page in the fifo */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
233 i64 aSlot[1]; /* One or more slots for rowid values */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
234 };
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
235
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
236 /*
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
237 ** The Fifo structure is typedef-ed in vdbeInt.h. But the implementation
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
238 ** of that structure is private to this file.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
239 **
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
240 ** The Fifo structure describes the entire fifo.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
241 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
242 typedef struct Fifo Fifo;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
243 struct Fifo {
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
244 int nEntry; /* Total number of entries */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
245 FifoPage *pFirst; /* First page on the list */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
246 FifoPage *pLast; /* Last page on the list */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
247 };
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
248
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
249 /*
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
250 ** A Context stores the last insert rowid, the last statement change count,
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
251 ** and the current statement change count (i.e. changes since last statement).
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
252 ** The current keylist is also stored in the context.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
253 ** Elements of Context structure type make up the ContextStack, which is
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
254 ** updated by the ContextPush and ContextPop opcodes (used by triggers).
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
255 ** The context is pushed before executing a trigger a popped when the
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
256 ** trigger finishes.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
257 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
258 typedef struct Context Context;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
259 struct Context {
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
260 i64 lastRowid; /* Last insert rowid (sqlite3.lastRowid) */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
261 int nChange; /* Statement changes (Vdbe.nChanges) */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
262 Fifo sFifo; /* Records that will participate in a DELETE or UPDATE */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
263 };
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
264
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
265 /*
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
266 ** An instance of the virtual machine. This structure contains the complete
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
267 ** state of the virtual machine.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
268 **
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
269 ** The "sqlite3_stmt" structure pointer that is returned by sqlite3_compile()
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
270 ** is really a pointer to an instance of this structure.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
271 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
272 struct Vdbe {
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
273 sqlite3 *db; /* The whole database */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
274 Vdbe *pPrev,*pNext; /* Linked list of VDBEs with the same Vdbe.db */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
275 FILE *trace; /* Write an execution trace here, if not NULL */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
276 int nOp; /* Number of instructions in the program */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
277 int nOpAlloc; /* Number of slots allocated for aOp[] */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
278 Op *aOp; /* Space to hold the virtual machine's program */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
279 int nLabel; /* Number of labels used */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
280 int nLabelAlloc; /* Number of slots allocated in aLabel[] */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
281 int *aLabel; /* Space to hold the labels */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
282 Mem *aStack; /* The operand stack, except string values */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
283 Mem *pTos; /* Top entry in the operand stack */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
284 Mem **apArg; /* Arguments to currently executing user function */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
285 Mem *aColName; /* Column names to return */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
286 int nCursor; /* Number of slots in apCsr[] */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
287 Cursor **apCsr; /* One element of this array for each open cursor */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
288 int nVar; /* Number of entries in aVar[] */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
289 Mem *aVar; /* Values for the OP_Variable opcode. */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
290 char **azVar; /* Name of variables */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
291 int okVar; /* True if azVar[] has been initialized */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
292 int magic; /* Magic number for sanity checking */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
293 int nMem; /* Number of memory locations currently allocated */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
294 Mem *aMem; /* The memory locations */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
295 int nCallback; /* Number of callbacks invoked so far */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
296 int cacheCtr; /* Cursor row cache generation counter */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
297 Fifo sFifo; /* A list of ROWIDs */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
298 int contextStackTop; /* Index of top element in the context stack */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
299 int contextStackDepth; /* The size of the "context" stack */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
300 Context *contextStack; /* Stack used by opcodes ContextPush & ContextPop*/
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
301 int pc; /* The program counter */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
302 int rc; /* Value to return */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
303 unsigned uniqueCnt; /* Used by OP_MakeRecord when P2!=0 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
304 int errorAction; /* Recovery action to do in case of an error */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
305 int inTempTrans; /* True if temp database is transactioned */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
306 int returnStack[100]; /* Return address stack for OP_Gosub & OP_Return */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
307 int returnDepth; /* Next unused element in returnStack[] */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
308 int nResColumn; /* Number of columns in one row of the result set */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
309 char **azResColumn; /* Values for one row of result */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
310 int popStack; /* Pop the stack this much on entry to VdbeExec() */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
311 char *zErrMsg; /* Error message written here */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
312 u8 resOnStack; /* True if there are result values on the stack */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
313 u8 explain; /* True if EXPLAIN present on SQL command */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
314 u8 changeCntOn; /* True to update the change-counter */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
315 u8 aborted; /* True if ROLLBACK in another VM causes an abort */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
316 u8 expired; /* True if the VM needs to be recompiled */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
317 u8 minWriteFileFormat; /* Minimum file format for writable database files */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
318 int nChange; /* Number of db changes made since last reset */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
319 i64 startTime; /* Time when query started - used for profiling */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
320 #ifdef SQLITE_SSE
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
321 int fetchId; /* Statement number used by sqlite3_fetch_statement */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
322 int lru; /* Counter used for LRU cache replacement */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
323 #endif
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
324 };
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
325
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
326 /*
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
327 ** The following are allowed values for Vdbe.magic
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
328 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
329 #define VDBE_MAGIC_INIT 0x26bceaa5 /* Building a VDBE program */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
330 #define VDBE_MAGIC_RUN 0xbdf20da3 /* VDBE is ready to execute */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
331 #define VDBE_MAGIC_HALT 0x519c2973 /* VDBE has completed execution */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
332 #define VDBE_MAGIC_DEAD 0xb606c3c8 /* The VDBE has been deallocated */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
333
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
334 /*
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
335 ** Function prototypes
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
336 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
337 void sqlite3VdbeFreeCursor(Cursor*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
338 void sqliteVdbePopStack(Vdbe*,int);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
339 int sqlite3VdbeCursorMoveto(Cursor*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
340 #if defined(SQLITE_DEBUG) || defined(VDBE_PROFILE)
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
341 void sqlite3VdbePrintOp(FILE*, int, Op*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
342 #endif
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
343 #ifdef SQLITE_DEBUG
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
344 void sqlite3VdbePrintSql(Vdbe*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
345 #endif
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
346 int sqlite3VdbeSerialTypeLen(u32);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
347 u32 sqlite3VdbeSerialType(Mem*, int);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
348 int sqlite3VdbeSerialPut(unsigned char*, Mem*, int);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
349 int sqlite3VdbeSerialGet(const unsigned char*, u32, Mem*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
350 void sqlite3VdbeDeleteAuxData(VdbeFunc*, int);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
351
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
352 int sqlite2BtreeKeyCompare(BtCursor *, const void *, int, int, int *);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
353 int sqlite3VdbeIdxKeyCompare(Cursor*, int , const unsigned char*, int*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
354 int sqlite3VdbeIdxRowid(BtCursor *, i64 *);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
355 int sqlite3MemCompare(const Mem*, const Mem*, const CollSeq*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
356 int sqlite3VdbeRecordCompare(void*,int,const void*,int, const void*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
357 int sqlite3VdbeIdxRowidLen(const u8*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
358 int sqlite3VdbeExec(Vdbe*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
359 int sqlite3VdbeList(Vdbe*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
360 int sqlite3VdbeHalt(Vdbe*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
361 int sqlite3VdbeChangeEncoding(Mem *, int);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
362 int sqlite3VdbeMemCopy(Mem*, const Mem*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
363 void sqlite3VdbeMemShallowCopy(Mem*, const Mem*, int);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
364 int sqlite3VdbeMemMove(Mem*, Mem*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
365 int sqlite3VdbeMemNulTerminate(Mem*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
366 int sqlite3VdbeMemSetStr(Mem*, const char*, int, u8, void(*)(void*));
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
367 void sqlite3VdbeMemSetInt64(Mem*, i64);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
368 void sqlite3VdbeMemSetDouble(Mem*, double);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
369 void sqlite3VdbeMemSetNull(Mem*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
370 int sqlite3VdbeMemMakeWriteable(Mem*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
371 int sqlite3VdbeMemDynamicify(Mem*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
372 int sqlite3VdbeMemStringify(Mem*, int);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
373 i64 sqlite3VdbeIntValue(Mem*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
374 int sqlite3VdbeMemIntegerify(Mem*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
375 double sqlite3VdbeRealValue(Mem*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
376 void sqlite3VdbeIntegerAffinity(Mem*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
377 int sqlite3VdbeMemRealify(Mem*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
378 int sqlite3VdbeMemNumerify(Mem*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
379 int sqlite3VdbeMemFromBtree(BtCursor*,int,int,int,Mem*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
380 void sqlite3VdbeMemRelease(Mem *p);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
381 int sqlite3VdbeMemFinalize(Mem*, FuncDef*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
382 #ifndef NDEBUG
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
383 void sqlite3VdbeMemSanity(Mem*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
384 int sqlite3VdbeOpcodeNoPush(u8);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
385 #endif
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
386 int sqlite3VdbeMemTranslate(Mem*, u8);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
387 void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
388 int sqlite3VdbeMemHandleBom(Mem *pMem);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
389 void sqlite3VdbeFifoInit(Fifo*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
390 int sqlite3VdbeFifoPush(Fifo*, i64);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
391 int sqlite3VdbeFifoPop(Fifo*, i64*);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
392 void sqlite3VdbeFifoClear(Fifo*);