OLD | NEW |
1 /* | 1 /* |
2 ** 2001 September 15 | 2 ** 2001 September 15 |
3 ** | 3 ** |
4 ** The author disclaims copyright to this source code. In place of | 4 ** The author disclaims copyright to this source code. In place of |
5 ** a legal notice, here is a blessing: | 5 ** a legal notice, here is a blessing: |
6 ** | 6 ** |
7 ** May you do good and not evil. | 7 ** May you do good and not evil. |
8 ** May you find forgiveness for yourself and forgive others. | 8 ** May you find forgiveness for yourself and forgive others. |
9 ** May you share freely, never taking more than you give. | 9 ** May you share freely, never taking more than you give. |
10 ** | 10 ** |
(...skipping 12 matching lines...) Expand all Loading... |
23 ** A single VDBE is an opaque structure named "Vdbe". Only routines | 23 ** A single VDBE is an opaque structure named "Vdbe". Only routines |
24 ** in the source file sqliteVdbe.c are allowed to see the insides | 24 ** in the source file sqliteVdbe.c are allowed to see the insides |
25 ** of this structure. | 25 ** of this structure. |
26 */ | 26 */ |
27 typedef struct Vdbe Vdbe; | 27 typedef struct Vdbe Vdbe; |
28 | 28 |
29 /* | 29 /* |
30 ** The names of the following types declared in vdbeInt.h are required | 30 ** The names of the following types declared in vdbeInt.h are required |
31 ** for the VdbeOp definition. | 31 ** for the VdbeOp definition. |
32 */ | 32 */ |
33 typedef struct VdbeFunc VdbeFunc; | |
34 typedef struct Mem Mem; | 33 typedef struct Mem Mem; |
35 typedef struct SubProgram SubProgram; | 34 typedef struct SubProgram SubProgram; |
36 | 35 |
37 /* | 36 /* |
38 ** A single instruction of the virtual machine has an opcode | 37 ** A single instruction of the virtual machine has an opcode |
39 ** and as many as three operands. The instruction is recorded | 38 ** and as many as three operands. The instruction is recorded |
40 ** as an instance of the following structure: | 39 ** as an instance of the following structure: |
41 */ | 40 */ |
42 struct VdbeOp { | 41 struct VdbeOp { |
43 u8 opcode; /* What operation to perform */ | 42 u8 opcode; /* What operation to perform */ |
44 signed char p4type; /* One of the P4_xxx constants for p4 */ | 43 signed char p4type; /* One of the P4_xxx constants for p4 */ |
45 u8 opflags; /* Mask of the OPFLG_* flags in opcodes.h */ | 44 u8 opflags; /* Mask of the OPFLG_* flags in opcodes.h */ |
46 u8 p5; /* Fifth parameter is an unsigned character */ | 45 u8 p5; /* Fifth parameter is an unsigned character */ |
47 int p1; /* First operand */ | 46 int p1; /* First operand */ |
48 int p2; /* Second parameter (often the jump destination) */ | 47 int p2; /* Second parameter (often the jump destination) */ |
49 int p3; /* The third parameter */ | 48 int p3; /* The third parameter */ |
50 union { /* fourth parameter */ | 49 union { /* fourth parameter */ |
51 int i; /* Integer value if p4type==P4_INT32 */ | 50 int i; /* Integer value if p4type==P4_INT32 */ |
52 void *p; /* Generic pointer */ | 51 void *p; /* Generic pointer */ |
53 char *z; /* Pointer to data for string (char array) types */ | 52 char *z; /* Pointer to data for string (char array) types */ |
54 i64 *pI64; /* Used when p4type is P4_INT64 */ | 53 i64 *pI64; /* Used when p4type is P4_INT64 */ |
55 double *pReal; /* Used when p4type is P4_REAL */ | 54 double *pReal; /* Used when p4type is P4_REAL */ |
56 FuncDef *pFunc; /* Used when p4type is P4_FUNCDEF */ | 55 FuncDef *pFunc; /* Used when p4type is P4_FUNCDEF */ |
57 VdbeFunc *pVdbeFunc; /* Used when p4type is P4_VDBEFUNC */ | |
58 CollSeq *pColl; /* Used when p4type is P4_COLLSEQ */ | 56 CollSeq *pColl; /* Used when p4type is P4_COLLSEQ */ |
59 Mem *pMem; /* Used when p4type is P4_MEM */ | 57 Mem *pMem; /* Used when p4type is P4_MEM */ |
60 VTable *pVtab; /* Used when p4type is P4_VTAB */ | 58 VTable *pVtab; /* Used when p4type is P4_VTAB */ |
61 KeyInfo *pKeyInfo; /* Used when p4type is P4_KEYINFO */ | 59 KeyInfo *pKeyInfo; /* Used when p4type is P4_KEYINFO */ |
62 int *ai; /* Used when p4type is P4_INTARRAY */ | 60 int *ai; /* Used when p4type is P4_INTARRAY */ |
63 SubProgram *pProgram; /* Used when p4type is P4_SUBPROGRAM */ | 61 SubProgram *pProgram; /* Used when p4type is P4_SUBPROGRAM */ |
| 62 int (*xAdvance)(BtCursor *, int *); |
64 } p4; | 63 } p4; |
65 #ifdef SQLITE_DEBUG | 64 #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS |
66 char *zComment; /* Comment to improve readability */ | 65 char *zComment; /* Comment to improve readability */ |
67 #endif | 66 #endif |
68 #ifdef VDBE_PROFILE | 67 #ifdef VDBE_PROFILE |
69 int cnt; /* Number of times this instruction was executed */ | 68 u32 cnt; /* Number of times this instruction was executed */ |
70 u64 cycles; /* Total time spent executing this instruction */ | 69 u64 cycles; /* Total time spent executing this instruction */ |
71 #endif | 70 #endif |
| 71 #ifdef SQLITE_VDBE_COVERAGE |
| 72 int iSrcLine; /* Source-code line that generated this opcode */ |
| 73 #endif |
72 }; | 74 }; |
73 typedef struct VdbeOp VdbeOp; | 75 typedef struct VdbeOp VdbeOp; |
74 | 76 |
75 | 77 |
76 /* | 78 /* |
77 ** A sub-routine used to implement a trigger program. | 79 ** A sub-routine used to implement a trigger program. |
78 */ | 80 */ |
79 struct SubProgram { | 81 struct SubProgram { |
80 VdbeOp *aOp; /* Array of opcodes for sub-program */ | 82 VdbeOp *aOp; /* Array of opcodes for sub-program */ |
81 int nOp; /* Elements in aOp[] */ | 83 int nOp; /* Elements in aOp[] */ |
82 int nMem; /* Number of memory cells required */ | 84 int nMem; /* Number of memory cells required */ |
83 int nCsr; /* Number of cursors required */ | 85 int nCsr; /* Number of cursors required */ |
| 86 int nOnce; /* Number of OP_Once instructions */ |
84 void *token; /* id that may be used to recursive triggers */ | 87 void *token; /* id that may be used to recursive triggers */ |
85 SubProgram *pNext; /* Next sub-program already visited */ | 88 SubProgram *pNext; /* Next sub-program already visited */ |
86 }; | 89 }; |
87 | 90 |
88 /* | 91 /* |
89 ** A smaller version of VdbeOp used for the VdbeAddOpList() function because | 92 ** A smaller version of VdbeOp used for the VdbeAddOpList() function because |
90 ** it takes up less space. | 93 ** it takes up less space. |
91 */ | 94 */ |
92 struct VdbeOpList { | 95 struct VdbeOpList { |
93 u8 opcode; /* What operation to perform */ | 96 u8 opcode; /* What operation to perform */ |
94 signed char p1; /* First operand */ | 97 signed char p1; /* First operand */ |
95 signed char p2; /* Second parameter (often the jump destination) */ | 98 signed char p2; /* Second parameter (often the jump destination) */ |
96 signed char p3; /* Third parameter */ | 99 signed char p3; /* Third parameter */ |
97 }; | 100 }; |
98 typedef struct VdbeOpList VdbeOpList; | 101 typedef struct VdbeOpList VdbeOpList; |
99 | 102 |
100 /* | 103 /* |
101 ** Allowed values of VdbeOp.p4type | 104 ** Allowed values of VdbeOp.p4type |
102 */ | 105 */ |
103 #define P4_NOTUSED 0 /* The P4 parameter is not used */ | 106 #define P4_NOTUSED 0 /* The P4 parameter is not used */ |
104 #define P4_DYNAMIC (-1) /* Pointer to a string obtained from sqliteMalloc() */ | 107 #define P4_DYNAMIC (-1) /* Pointer to a string obtained from sqliteMalloc() */ |
105 #define P4_STATIC (-2) /* Pointer to a static string */ | 108 #define P4_STATIC (-2) /* Pointer to a static string */ |
106 #define P4_COLLSEQ (-4) /* P4 is a pointer to a CollSeq structure */ | 109 #define P4_COLLSEQ (-4) /* P4 is a pointer to a CollSeq structure */ |
107 #define P4_FUNCDEF (-5) /* P4 is a pointer to a FuncDef structure */ | 110 #define P4_FUNCDEF (-5) /* P4 is a pointer to a FuncDef structure */ |
108 #define P4_KEYINFO (-6) /* P4 is a pointer to a KeyInfo structure */ | 111 #define P4_KEYINFO (-6) /* P4 is a pointer to a KeyInfo structure */ |
109 #define P4_VDBEFUNC (-7) /* P4 is a pointer to a VdbeFunc structure */ | |
110 #define P4_MEM (-8) /* P4 is a pointer to a Mem* structure */ | 112 #define P4_MEM (-8) /* P4 is a pointer to a Mem* structure */ |
111 #define P4_TRANSIENT 0 /* P4 is a pointer to a transient string */ | 113 #define P4_TRANSIENT 0 /* P4 is a pointer to a transient string */ |
112 #define P4_VTAB (-10) /* P4 is a pointer to an sqlite3_vtab structure */ | 114 #define P4_VTAB (-10) /* P4 is a pointer to an sqlite3_vtab structure */ |
113 #define P4_MPRINTF (-11) /* P4 is a string obtained from sqlite3_mprintf() */ | 115 #define P4_MPRINTF (-11) /* P4 is a string obtained from sqlite3_mprintf() */ |
114 #define P4_REAL (-12) /* P4 is a 64-bit floating point value */ | 116 #define P4_REAL (-12) /* P4 is a 64-bit floating point value */ |
115 #define P4_INT64 (-13) /* P4 is a 64-bit signed integer */ | 117 #define P4_INT64 (-13) /* P4 is a 64-bit signed integer */ |
116 #define P4_INT32 (-14) /* P4 is a 32-bit signed integer */ | 118 #define P4_INT32 (-14) /* P4 is a 32-bit signed integer */ |
117 #define P4_INTARRAY (-15) /* P4 is a vector of 32-bit integers */ | 119 #define P4_INTARRAY (-15) /* P4 is a vector of 32-bit integers */ |
118 #define P4_SUBPROGRAM (-18) /* P4 is a pointer to a SubProgram structure */ | 120 #define P4_SUBPROGRAM (-18) /* P4 is a pointer to a SubProgram structure */ |
| 121 #define P4_ADVANCE (-19) /* P4 is a pointer to BtreeNext() or BtreePrev() */ |
119 | 122 |
120 /* When adding a P4 argument using P4_KEYINFO, a copy of the KeyInfo structure | 123 /* Error message codes for OP_Halt */ |
121 ** is made. That copy is freed when the Vdbe is finalized. But if the | 124 #define P5_ConstraintNotNull 1 |
122 ** argument is P4_KEYINFO_HANDOFF, the passed in pointer is used. It still | 125 #define P5_ConstraintUnique 2 |
123 ** gets freed when the Vdbe is finalized so it still should be obtained | 126 #define P5_ConstraintCheck 3 |
124 ** from a single sqliteMalloc(). But no copy is made and the calling | 127 #define P5_ConstraintFK 4 |
125 ** function should *not* try to free the KeyInfo. | |
126 */ | |
127 #define P4_KEYINFO_HANDOFF (-16) | |
128 #define P4_KEYINFO_STATIC (-17) | |
129 | 128 |
130 /* | 129 /* |
131 ** The Vdbe.aColName array contains 5n Mem structures, where n is the | 130 ** The Vdbe.aColName array contains 5n Mem structures, where n is the |
132 ** number of columns of data returned by the statement. | 131 ** number of columns of data returned by the statement. |
133 */ | 132 */ |
134 #define COLNAME_NAME 0 | 133 #define COLNAME_NAME 0 |
135 #define COLNAME_DECLTYPE 1 | 134 #define COLNAME_DECLTYPE 1 |
136 #define COLNAME_DATABASE 2 | 135 #define COLNAME_DATABASE 2 |
137 #define COLNAME_TABLE 3 | 136 #define COLNAME_TABLE 3 |
138 #define COLNAME_COLUMN 4 | 137 #define COLNAME_COLUMN 4 |
(...skipping 18 matching lines...) Expand all Loading... |
157 /* | 156 /* |
158 ** The makefile scans the vdbe.c source file and creates the "opcodes.h" | 157 ** The makefile scans the vdbe.c source file and creates the "opcodes.h" |
159 ** header file that defines a number for each opcode used by the VDBE. | 158 ** header file that defines a number for each opcode used by the VDBE. |
160 */ | 159 */ |
161 #include "opcodes.h" | 160 #include "opcodes.h" |
162 | 161 |
163 /* | 162 /* |
164 ** Prototypes for the VDBE interface. See comments on the implementation | 163 ** Prototypes for the VDBE interface. See comments on the implementation |
165 ** for a description of what each of these routines does. | 164 ** for a description of what each of these routines does. |
166 */ | 165 */ |
167 Vdbe *sqlite3VdbeCreate(sqlite3*); | 166 Vdbe *sqlite3VdbeCreate(Parse*); |
168 int sqlite3VdbeAddOp0(Vdbe*,int); | 167 int sqlite3VdbeAddOp0(Vdbe*,int); |
169 int sqlite3VdbeAddOp1(Vdbe*,int,int); | 168 int sqlite3VdbeAddOp1(Vdbe*,int,int); |
170 int sqlite3VdbeAddOp2(Vdbe*,int,int,int); | 169 int sqlite3VdbeAddOp2(Vdbe*,int,int,int); |
171 int sqlite3VdbeAddOp3(Vdbe*,int,int,int,int); | 170 int sqlite3VdbeAddOp3(Vdbe*,int,int,int,int); |
172 int sqlite3VdbeAddOp4(Vdbe*,int,int,int,int,const char *zP4,int); | 171 int sqlite3VdbeAddOp4(Vdbe*,int,int,int,int,const char *zP4,int); |
173 int sqlite3VdbeAddOp4Int(Vdbe*,int,int,int,int,int); | 172 int sqlite3VdbeAddOp4Int(Vdbe*,int,int,int,int,int); |
174 int sqlite3VdbeAddOpList(Vdbe*, int nOp, VdbeOpList const *aOp); | 173 int sqlite3VdbeAddOpList(Vdbe*, int nOp, VdbeOpList const *aOp, int iLineno); |
175 void sqlite3VdbeChangeP1(Vdbe*, int addr, int P1); | 174 void sqlite3VdbeAddParseSchemaOp(Vdbe*,int,char*); |
176 void sqlite3VdbeChangeP2(Vdbe*, int addr, int P2); | 175 void sqlite3VdbeChangeP1(Vdbe*, u32 addr, int P1); |
177 void sqlite3VdbeChangeP3(Vdbe*, int addr, int P3); | 176 void sqlite3VdbeChangeP2(Vdbe*, u32 addr, int P2); |
| 177 void sqlite3VdbeChangeP3(Vdbe*, u32 addr, int P3); |
178 void sqlite3VdbeChangeP5(Vdbe*, u8 P5); | 178 void sqlite3VdbeChangeP5(Vdbe*, u8 P5); |
179 void sqlite3VdbeJumpHere(Vdbe*, int addr); | 179 void sqlite3VdbeJumpHere(Vdbe*, int addr); |
180 void sqlite3VdbeChangeToNoop(Vdbe*, int addr, int N); | 180 void sqlite3VdbeChangeToNoop(Vdbe*, int addr); |
| 181 int sqlite3VdbeDeletePriorOpcode(Vdbe*, u8 op); |
181 void sqlite3VdbeChangeP4(Vdbe*, int addr, const char *zP4, int N); | 182 void sqlite3VdbeChangeP4(Vdbe*, int addr, const char *zP4, int N); |
| 183 void sqlite3VdbeSetP4KeyInfo(Parse*, Index*); |
182 void sqlite3VdbeUsesBtree(Vdbe*, int); | 184 void sqlite3VdbeUsesBtree(Vdbe*, int); |
183 VdbeOp *sqlite3VdbeGetOp(Vdbe*, int); | 185 VdbeOp *sqlite3VdbeGetOp(Vdbe*, int); |
184 int sqlite3VdbeMakeLabel(Vdbe*); | 186 int sqlite3VdbeMakeLabel(Vdbe*); |
185 void sqlite3VdbeRunOnlyOnce(Vdbe*); | 187 void sqlite3VdbeRunOnlyOnce(Vdbe*); |
186 void sqlite3VdbeDelete(Vdbe*); | 188 void sqlite3VdbeDelete(Vdbe*); |
187 void sqlite3VdbeDeleteObject(sqlite3*,Vdbe*); | 189 void sqlite3VdbeClearObject(sqlite3*,Vdbe*); |
188 void sqlite3VdbeMakeReady(Vdbe*,int,int,int,int,int,int); | 190 void sqlite3VdbeMakeReady(Vdbe*,Parse*); |
189 int sqlite3VdbeFinalize(Vdbe*); | 191 int sqlite3VdbeFinalize(Vdbe*); |
190 void sqlite3VdbeResolveLabel(Vdbe*, int); | 192 void sqlite3VdbeResolveLabel(Vdbe*, int); |
191 int sqlite3VdbeCurrentAddr(Vdbe*); | 193 int sqlite3VdbeCurrentAddr(Vdbe*); |
192 #ifdef SQLITE_DEBUG | 194 #ifdef SQLITE_DEBUG |
193 int sqlite3VdbeAssertMayAbort(Vdbe *, int); | 195 int sqlite3VdbeAssertMayAbort(Vdbe *, int); |
194 void sqlite3VdbeTrace(Vdbe*,FILE*); | |
195 #endif | 196 #endif |
196 void sqlite3VdbeResetStepResult(Vdbe*); | 197 void sqlite3VdbeResetStepResult(Vdbe*); |
| 198 void sqlite3VdbeRewind(Vdbe*); |
197 int sqlite3VdbeReset(Vdbe*); | 199 int sqlite3VdbeReset(Vdbe*); |
198 void sqlite3VdbeSetNumCols(Vdbe*,int); | 200 void sqlite3VdbeSetNumCols(Vdbe*,int); |
199 int sqlite3VdbeSetColName(Vdbe*, int, int, const char *, void(*)(void*)); | 201 int sqlite3VdbeSetColName(Vdbe*, int, int, const char *, void(*)(void*)); |
200 void sqlite3VdbeCountChanges(Vdbe*); | 202 void sqlite3VdbeCountChanges(Vdbe*); |
201 sqlite3 *sqlite3VdbeDb(Vdbe*); | 203 sqlite3 *sqlite3VdbeDb(Vdbe*); |
202 void sqlite3VdbeSetSql(Vdbe*, const char *z, int n, int); | 204 void sqlite3VdbeSetSql(Vdbe*, const char *z, int n, int); |
203 void sqlite3VdbeSwap(Vdbe*,Vdbe*); | 205 void sqlite3VdbeSwap(Vdbe*,Vdbe*); |
204 VdbeOp *sqlite3VdbeTakeOpArray(Vdbe*, int*, int*); | 206 VdbeOp *sqlite3VdbeTakeOpArray(Vdbe*, int*, int*); |
205 sqlite3_value *sqlite3VdbeGetValue(Vdbe*, int, u8); | 207 sqlite3_value *sqlite3VdbeGetBoundValue(Vdbe*, int, u8); |
206 void sqlite3VdbeSetVarmask(Vdbe*, int); | 208 void sqlite3VdbeSetVarmask(Vdbe*, int); |
207 #ifndef SQLITE_OMIT_TRACE | 209 #ifndef SQLITE_OMIT_TRACE |
208 char *sqlite3VdbeExpandSql(Vdbe*, const char*); | 210 char *sqlite3VdbeExpandSql(Vdbe*, const char*); |
209 #endif | 211 #endif |
| 212 int sqlite3MemCompare(const Mem*, const Mem*, const CollSeq*); |
210 | 213 |
211 UnpackedRecord *sqlite3VdbeRecordUnpack(KeyInfo*,int,const void*,char*,int); | 214 void sqlite3VdbeRecordUnpack(KeyInfo*,int,const void*,UnpackedRecord*); |
212 void sqlite3VdbeDeleteUnpackedRecord(UnpackedRecord*); | |
213 int sqlite3VdbeRecordCompare(int,const void*,UnpackedRecord*); | 215 int sqlite3VdbeRecordCompare(int,const void*,UnpackedRecord*); |
| 216 UnpackedRecord *sqlite3VdbeAllocUnpackedRecord(KeyInfo *, char *, int, char **); |
| 217 |
| 218 typedef int (*RecordCompare)(int,const void*,UnpackedRecord*); |
| 219 RecordCompare sqlite3VdbeFindCompare(UnpackedRecord*); |
214 | 220 |
215 #ifndef SQLITE_OMIT_TRIGGER | 221 #ifndef SQLITE_OMIT_TRIGGER |
216 void sqlite3VdbeLinkSubProgram(Vdbe *, SubProgram *); | 222 void sqlite3VdbeLinkSubProgram(Vdbe *, SubProgram *); |
217 #endif | 223 #endif |
218 | 224 |
219 | 225 /* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on |
220 #ifndef NDEBUG | 226 ** each VDBE opcode. |
| 227 ** |
| 228 ** Use the SQLITE_ENABLE_MODULE_COMMENTS macro to see some extra no-op |
| 229 ** comments in VDBE programs that show key decision points in the code |
| 230 ** generator. |
| 231 */ |
| 232 #ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS |
221 void sqlite3VdbeComment(Vdbe*, const char*, ...); | 233 void sqlite3VdbeComment(Vdbe*, const char*, ...); |
222 # define VdbeComment(X) sqlite3VdbeComment X | 234 # define VdbeComment(X) sqlite3VdbeComment X |
223 void sqlite3VdbeNoopComment(Vdbe*, const char*, ...); | 235 void sqlite3VdbeNoopComment(Vdbe*, const char*, ...); |
224 # define VdbeNoopComment(X) sqlite3VdbeNoopComment X | 236 # define VdbeNoopComment(X) sqlite3VdbeNoopComment X |
| 237 # ifdef SQLITE_ENABLE_MODULE_COMMENTS |
| 238 # define VdbeModuleComment(X) sqlite3VdbeNoopComment X |
| 239 # else |
| 240 # define VdbeModuleComment(X) |
| 241 # endif |
225 #else | 242 #else |
226 # define VdbeComment(X) | 243 # define VdbeComment(X) |
227 # define VdbeNoopComment(X) | 244 # define VdbeNoopComment(X) |
| 245 # define VdbeModuleComment(X) |
| 246 #endif |
| 247 |
| 248 /* |
| 249 ** The VdbeCoverage macros are used to set a coverage testing point |
| 250 ** for VDBE branch instructions. The coverage testing points are line |
| 251 ** numbers in the sqlite3.c source file. VDBE branch coverage testing |
| 252 ** only works with an amalagmation build. That's ok since a VDBE branch |
| 253 ** coverage build designed for testing the test suite only. No application |
| 254 ** should ever ship with VDBE branch coverage measuring turned on. |
| 255 ** |
| 256 ** VdbeCoverage(v) // Mark the previously coded instruction |
| 257 ** // as a branch |
| 258 ** |
| 259 ** VdbeCoverageIf(v, conditional) // Mark previous if conditional true |
| 260 ** |
| 261 ** VdbeCoverageAlwaysTaken(v) // Previous branch is always taken |
| 262 ** |
| 263 ** VdbeCoverageNeverTaken(v) // Previous branch is never taken |
| 264 ** |
| 265 ** Every VDBE branch operation must be tagged with one of the macros above. |
| 266 ** If not, then when "make test" is run with -DSQLITE_VDBE_COVERAGE and |
| 267 ** -DSQLITE_DEBUG then an ALWAYS() will fail in the vdbeTakeBranch() |
| 268 ** routine in vdbe.c, alerting the developer to the missed tag. |
| 269 */ |
| 270 #ifdef SQLITE_VDBE_COVERAGE |
| 271 void sqlite3VdbeSetLineNumber(Vdbe*,int); |
| 272 # define VdbeCoverage(v) sqlite3VdbeSetLineNumber(v,__LINE__) |
| 273 # define VdbeCoverageIf(v,x) if(x)sqlite3VdbeSetLineNumber(v,__LINE__) |
| 274 # define VdbeCoverageAlwaysTaken(v) sqlite3VdbeSetLineNumber(v,2); |
| 275 # define VdbeCoverageNeverTaken(v) sqlite3VdbeSetLineNumber(v,1); |
| 276 # define VDBE_OFFSET_LINENO(x) (__LINE__+x) |
| 277 #else |
| 278 # define VdbeCoverage(v) |
| 279 # define VdbeCoverageIf(v,x) |
| 280 # define VdbeCoverageAlwaysTaken(v) |
| 281 # define VdbeCoverageNeverTaken(v) |
| 282 # define VDBE_OFFSET_LINENO(x) 0 |
228 #endif | 283 #endif |
229 | 284 |
230 #endif | 285 #endif |
OLD | NEW |