OpenCoverage

vdbe.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/sqlite/src/src/vdbe.c
Source codeSwitch to Preprocessed file
LineSourceCount
1/*-
2** 2001 September 15-
3**-
4** The author disclaims copyright to this source code. In place of-
5** a legal notice, here is a blessing:-
6**-
7** May you do good and not evil.-
8** May you find forgiveness for yourself and forgive others.-
9** May you share freely, never taking more than you give.-
10**-
11*************************************************************************-
12** The code in this file implements the function that runs the-
13** bytecode of a prepared statement.-
14**-
15** Various scripts scan this source file in order to generate HTML-
16** documentation, headers files, or other derived files. The formatting-
17** of the code in this file is, therefore, important. See other comments-
18** in this file for details. If in doubt, do not deviate from existing-
19** commenting and indentation practices when changing or adding code.-
20*/-
21#include "sqliteInt.h"-
22#include "vdbeInt.h"-
23-
24/*-
25** Invoke this macro on memory cells just prior to changing the-
26** value of the cell. This macro verifies that shallow copies are-
27** not misused. A shallow copy of a string or blob just copies a-
28** pointer to the string or blob, not the content. If the original-
29** is changed while the copy is still in use, the string or blob might-
30** be changed out from under the copy. This macro verifies that nothing-
31** like that ever happens.-
32*/-
33#ifdef SQLITE_DEBUG-
34# define memAboutToChange(P,M) sqlite3VdbeMemAboutToChange(P,M)-
35#else-
36# define memAboutToChange(P,M)-
37#endif-
38-
39/*-
40** The following global variable is incremented every time a cursor-
41** moves, either by the OP_SeekXX, OP_Next, or OP_Prev opcodes. The test-
42** procedures use this information to make sure that indices are-
43** working correctly. This variable has no function other than to-
44** help verify the correct operation of the library.-
45*/-
46#ifdef SQLITE_TEST-
47int sqlite3_search_count = 0;-
48#endif-
49-
50/*-
51** When this global variable is positive, it gets decremented once before-
52** each instruction in the VDBE. When it reaches zero, the u1.isInterrupted-
53** field of the sqlite3 structure is set in order to simulate an interrupt.-
54**-
55** This facility is used for testing purposes only. It does not function-
56** in an ordinary build.-
57*/-
58#ifdef SQLITE_TEST-
59int sqlite3_interrupt_count = 0;-
60#endif-
61-
62/*-
63** The next global variable is incremented each type the OP_Sort opcode-
64** is executed. The test procedures use this information to make sure that-
65** sorting is occurring or not occurring at appropriate times. This variable-
66** has no function other than to help verify the correct operation of the-
67** library.-
68*/-
69#ifdef SQLITE_TEST-
70int sqlite3_sort_count = 0;-
71#endif-
72-
73/*-
74** The next global variable records the size of the largest MEM_Blob-
75** or MEM_Str that has been used by a VDBE opcode. The test procedures-
76** use this information to make sure that the zero-blob functionality-
77** is working correctly. This variable has no function other than to-
78** help verify the correct operation of the library.-
79*/-
80#ifdef SQLITE_TEST-
81int sqlite3_max_blobsize = 0;-
82static void updateMaxBlobsize(Mem *p){-
83 if( (p->flags & (MEM_Str|MEM_Blob))!=0 && p->n>sqlite3_max_blobsize ){
(p->flags & (0...02|0x0010))!=0Description
TRUEevaluated 32678942 times by 435 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
FALSEevaluated 23091609 times by 435 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
p->n>sqlite3_max_blobsizeDescription
TRUEevaluated 1808 times by 435 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
FALSEevaluated 32677134 times by 429 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • ...
1808-32678942
84 sqlite3_max_blobsize = p->n;-
85 }
executed 1808 times by 435 tests: end of block
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
1808
86}
executed 55770551 times by 435 tests: end of block
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
55770551
87#endif-
88-
89/*-
90** This macro evaluates to true if either the update hook or the preupdate-
91** hook are enabled for database connect DB.-
92*/-
93#ifdef SQLITE_ENABLE_PREUPDATE_HOOK-
94# define HAS_UPDATE_HOOK(DB) ((DB)->xPreUpdateCallback||(DB)->xUpdateCallback)-
95#else-
96# define HAS_UPDATE_HOOK(DB) ((DB)->xUpdateCallback)-
97#endif-
98-
99/*-
100** The next global variable is incremented each time the OP_Found opcode-
101** is executed. This is used to test whether or not the foreign key-
102** operation implemented using OP_FkIsZero is working. This variable-
103** has no function other than to help verify the correct operation of the-
104** library.-
105*/-
106#ifdef SQLITE_TEST-
107int sqlite3_found_count = 0;-
108#endif-
109-
110/*-
111** Test a register to see if it exceeds the current maximum blob size.-
112** If it does, record the new maximum blob size.-
113*/-
114#if defined(SQLITE_TEST) && !defined(SQLITE_UNTESTABLE)-
115# define UPDATE_MAX_BLOBSIZE(P) updateMaxBlobsize(P)-
116#else-
117# define UPDATE_MAX_BLOBSIZE(P)-
118#endif-
119-
120/*-
121** Invoke the VDBE coverage callback, if that callback is defined. This-
122** feature is used for test suite validation only and does not appear an-
123** production builds.-
124**-
125** M is an integer between 2 and 4. 2 indicates a ordinary two-way-
126** branch (I=0 means fall through and I=1 means taken). 3 indicates-
127** a 3-way branch where the third way is when one of the operands is-
128** NULL. 4 indicates the OP_Jump instruction which has three destinations-
129** depending on whether the first operand is less than, equal to, or greater-
130** than the second. -
131**-
132** iSrcLine is the source code line (from the __LINE__ macro) that-
133** generated the VDBE instruction combined with flag bits. The source-
134** code line number is in the lower 24 bits of iSrcLine and the upper-
135** 8 bytes are flags. The lower three bits of the flags indicate-
136** values for I that should never occur. For example, if the branch is-
137** always taken, the flags should be 0x05 since the fall-through and-
138** alternate branch are never taken. If a branch is never taken then-
139** flags should be 0x06 since only the fall-through approach is allowed.-
140**-
141** Bit 0x04 of the flags indicates an OP_Jump opcode that is only-
142** interested in equal or not-equal. In other words, I==0 and I==2-
143** should be treated the same.-
144**-
145** Since only a line number is retained, not the filename, this macro-
146** only works for amalgamation builds. But that is ok, since these macros-
147** should be no-ops except for special builds used to measure test coverage.-
148*/-
149#if !defined(SQLITE_VDBE_COVERAGE)-
150# define VdbeBranchTaken(I,M)-
151#else-
152# define VdbeBranchTaken(I,M) vdbeTakeBranch(pOp->iSrcLine,I,M)-
153 static void vdbeTakeBranch(u32 iSrcLine, u8 I, u8 M){-
154 u8 mNever;-
155 assert( I<=2 ); /* 0: fall through, 1: taken, 2: alternate taken */-
156 assert( M<=4 ); /* 2: two-way branch, 3: three-way branch, 4: OP_Jump */-
157 assert( I<M ); /* I can only be 2 if M is 3 or 4 */-
158 /* Transform I from a integer [0,1,2] into a bitmask of [1,2,4] */-
159 I = 1<<I;-
160 /* The upper 8 bits of iSrcLine are flags. The lower three bits of-
161 ** the flags indicate directions that the branch can never go. If-
162 ** a branch really does go in one of those directions, assert right-
163 ** away. */-
164 mNever = iSrcLine >> 24;-
165 assert( (I & mNever)==0 );-
166 if( sqlite3GlobalConfig.xVdbeBranch==0 ) return; /*NO_TEST*/-
167 I |= mNever;-
168 if( M==2 ) I |= 0x04;-
169 if( M==4 ){-
170 I |= 0x08;-
171 if( (mNever&0x08)!=0 && (I&0x05)!=0) I |= 0x05; /*NO_TEST*/-
172 }-
173 sqlite3GlobalConfig.xVdbeBranch(sqlite3GlobalConfig.pVdbeBranchArg,-
174 iSrcLine&0xffffff, I, M);-
175 }-
176#endif-
177-
178/*-
179** Convert the given register into a string if it isn't one-
180** already. Return non-zero if a malloc() fails.-
181*/-
182#define Stringify(P, enc) \-
183 if(((P)->flags&(MEM_Str|MEM_Blob))==0 && sqlite3VdbeMemStringify(P,enc,0)) \-
184 { goto no_mem; }-
185-
186/*-
187** An ephemeral string value (signified by the MEM_Ephem flag) contains-
188** a pointer to a dynamically allocated string where some other entity-
189** is responsible for deallocating that string. Because the register-
190** does not control the string, it might be deleted without the register-
191** knowing it.-
192**-
193** This routine converts an ephemeral string into a dynamically allocated-
194** string that the register itself controls. In other words, it-
195** converts an MEM_Ephem string into a string with P.z==P.zMalloc.-
196*/-
197#define Deephemeralize(P) \-
198 if( ((P)->flags&MEM_Ephem)!=0 \-
199 && sqlite3VdbeMemMakeWriteable(P) ){ goto no_mem;}-
200-
201/* Return true if the cursor was opened using the OP_OpenSorter opcode. */-
202#define isSorter(x) ((x)->eCurType==CURTYPE_SORTER)-
203-
204/*-
205** Allocate VdbeCursor number iCur. Return a pointer to it. Return NULL-
206** if we run out of memory.-
207*/-
208static VdbeCursor *allocateCursor(-
209 Vdbe *p, /* The virtual machine */-
210 int iCur, /* Index of the new VdbeCursor */-
211 int nField, /* Number of fields in the table or index */-
212 int iDb, /* Database the cursor belongs to, or -1 */-
213 u8 eCurType /* Type of the new cursor */-
214){-
215 /* Find the memory cell that will be used to store the blob of memory-
216 ** required for this VdbeCursor structure. It is convenient to use a -
217 ** vdbe memory cell to manage the memory allocation required for a-
218 ** VdbeCursor structure for the following reasons:-
219 **-
220 ** * Sometimes cursor numbers are used for a couple of different-
221 ** purposes in a vdbe program. The different uses might require-
222 ** different sized allocations. Memory cells provide growable-
223 ** allocations.-
224 **-
225 ** * When using ENABLE_MEMORY_MANAGEMENT, memory cell buffers can-
226 ** be freed lazily via the sqlite3_release_memory() API. This-
227 ** minimizes the number of malloc calls made by the system.-
228 **-
229 ** The memory cell for cursor 0 is aMem[0]. The rest are allocated from-
230 ** the top of the register space. Cursor 1 is at Mem[p->nMem-1].-
231 ** Cursor 2 is at Mem[p->nMem-2]. And so forth.-
232 */-
233 Mem *pMem = iCur>0 ? &p->aMem[p->nMem-iCur] : p->aMem;
iCur>0Description
TRUEevaluated 1212955 times by 399 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • ...
FALSEevaluated 790623 times by 435 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
790623-1212955
234-
235 int nByte;-
236 VdbeCursor *pCx = 0;-
237 nByte = -
238 ROUND8(sizeof(VdbeCursor)) + 2*sizeof(u32)*nField + -
239 (eCurType==CURTYPE_BTREE?sqlite3BtreeCursorSize():0);
eCurType==0Description
TRUEevaluated 1915184 times by 435 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
FALSEevaluated 88394 times by 10 tests
Evaluated by:
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (42)
  • Self test (438)
  • Self test (44)
  • Self test (46)
  • Self test (47)
88394-1915184
240-
241 assert( iCur>=0 && iCur<p->nCursor );-
242 if( p->apCsr[iCur] ){ /*OPTIMIZATION-IF-FALSE*/
p->apCsr[iCur]Description
TRUEevaluated 250681 times by 12 tests
Evaluated by:
  • Self test (43)
  • Self test (438)
  • Self test (45)
  • Self test (53)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (74)
FALSEevaluated 1752897 times by 435 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
250681-1752897
243 sqlite3VdbeFreeCursor(p, p->apCsr[iCur]);-
244 p->apCsr[iCur] = 0;-
245 }
executed 250681 times by 12 tests: end of block
Executed by:
  • Self test (43)
  • Self test (438)
  • Self test (45)
  • Self test (53)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (74)
250681
246 if( SQLITE_OK==sqlite3VdbeMemClearAndResize(pMem, nByte) ){
0==sqlite3Vdbe...e(pMem, nByte)Description
TRUEevaluated 2003533 times by 435 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
FALSEevaluated 45 times by 1 test
Evaluated by:
  • Self test (438)
45-2003533
247 p->apCsr[iCur] = pCx = (VdbeCursor*)pMem->z;-
248 memset(pCx, 0, offsetof(VdbeCursor,pAltCursor));-
249 pCx->eCurType = eCurType;-
250 pCx->iDb = iDb;-
251 pCx->nField = nField;-
252 pCx->aOffset = &pCx->aType[nField];-
253 if( eCurType==CURTYPE_BTREE ){
eCurType==0Description
TRUEevaluated 1915141 times by 435 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
FALSEevaluated 88392 times by 10 tests
Evaluated by:
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (42)
  • Self test (438)
  • Self test (44)
  • Self test (46)
  • Self test (47)
88392-1915141
254 pCx->uc.pCursor = (BtCursor*)-
255 &pMem->z[ROUND8(sizeof(VdbeCursor))+2*sizeof(u32)*nField];-
256 sqlite3BtreeCursorZero(pCx->uc.pCursor);-
257 }
executed 1915141 times by 435 tests: end of block
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
1915141
258 }
executed 2003533 times by 435 tests: end of block
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
2003533
259 return pCx;
executed 2003578 times by 435 tests: return pCx;
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
2003578
260}-
261-
262/*-
263** Try to convert a value into a numeric representation if we can-
264** do so without loss of information. In other words, if the string-
265** looks like a number, convert it into a number. If it does not-
266** look like a number, leave it alone.-
267**-
268** If the bTryForInt flag is true, then extra effort is made to give-
269** an integer representation. Strings that look like floating point-
270** values but which have no fractional component (example: '48.00')-
271** will have a MEM_Int representation when bTryForInt is true.-
272**-
273** If bTryForInt is false, then if the input string contains a decimal-
274** point or exponential notation, the result is only MEM_Real, even-
275** if there is an exact integer representation of the quantity.-
276*/-
277static void applyNumericAffinity(Mem *pRec, int bTryForInt){-
278 double rValue;-
279 i64 iValue;-
280 u8 enc = pRec->enc;-
281 assert( (pRec->flags & (MEM_Str|MEM_Int|MEM_Real))==MEM_Str );-
282 if( sqlite3AtoF(pRec->z, &rValue, pRec->n, enc)==0 ) return;
executed 657859 times by 1 test: return;
Executed by:
  • Self test (438)
sqlite3AtoF(pR...ec->n, enc)==0Description
TRUEevaluated 657859 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 4047635 times by 1 test
Evaluated by:
  • Self test (438)
657859-4047635
283 if( 0==sqlite3Atoi64(pRec->z, &iValue, pRec->n, enc) ){
0==sqlite3Atoi... pRec->n, enc)Description
TRUEevaluated 4028759 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 18876 times by 1 test
Evaluated by:
  • Self test (438)
18876-4028759
284 pRec->u.i = iValue;-
285 pRec->flags |= MEM_Int;-
286 }else{
executed 4028759 times by 1 test: end of block
Executed by:
  • Self test (438)
4028759
287 pRec->u.r = rValue;-
288 pRec->flags |= MEM_Real;-
289 if( bTryForInt ) sqlite3VdbeIntegerAffinity(pRec);
executed 280 times by 1 test: sqlite3VdbeIntegerAffinity(pRec);
Executed by:
  • Self test (438)
bTryForIntDescription
TRUEevaluated 280 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 18596 times by 1 test
Evaluated by:
  • Self test (438)
280-18596
290 }
executed 18876 times by 1 test: end of block
Executed by:
  • Self test (438)
18876
291 /* TEXT->NUMERIC is many->one. Hence, it is important to invalidate the-
292 ** string representation after computing a numeric equivalent, because the-
293 ** string representation might not be the canonical representation for the-
294 ** numeric value. Ticket [343634942dd54ab57b7024] 2018-01-31. */-
295 pRec->flags &= ~MEM_Str;-
296}
executed 4047635 times by 1 test: end of block
Executed by:
  • Self test (438)
4047635
297-
298/*-
299** Processing is determine by the affinity parameter:-
300**-
301** SQLITE_AFF_INTEGER:-
302** SQLITE_AFF_REAL:-
303** SQLITE_AFF_NUMERIC:-
304** Try to convert pRec to an integer representation or a -
305** floating-point representation if an integer representation-
306** is not possible. Note that the integer representation is-
307** always preferred, even if the affinity is REAL, because-
308** an integer representation is more space efficient on disk.-
309**-
310** SQLITE_AFF_TEXT:-
311** Convert pRec to a text representation.-
312**-
313** SQLITE_AFF_BLOB:-
314** No-op. pRec is unchanged.-
315*/-
316static void applyAffinity(-
317 Mem *pRec, /* The value to apply affinity to */-
318 char affinity, /* The affinity to be applied */-
319 u8 enc /* Use this text encoding */-
320){-
321 if( affinity>=SQLITE_AFF_NUMERIC ){
affinity>='C'Description
TRUEevaluated 1056190 times by 363 tests
Evaluated by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • ...
FALSEevaluated 403693 times by 31 tests
Evaluated by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (42)
  • Self test (438)
  • Self test (44)
  • Self test (46)
  • Self test (47)
  • Self test (48)
  • Self test (57)
  • Self test (58)
  • Self test (72)
  • Self test (73)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • ...
403693-1056190
322 assert( affinity==SQLITE_AFF_INTEGER || affinity==SQLITE_AFF_REAL-
323 || affinity==SQLITE_AFF_NUMERIC );-
324 if( (pRec->flags & MEM_Int)==0 ){ /*OPTIMIZATION-IF-FALSE*/
(pRec->flags & 0x0004)==0Description
TRUEevaluated 406915 times by 336 tests
Evaluated by:
  • Self test
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • Self test (127)
  • Self test (128)
  • Self test (129)
  • ...
FALSEevaluated 649275 times by 31 tests
Evaluated by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (42)
  • Self test (438)
  • Self test (44)
  • Self test (46)
  • Self test (47)
  • Self test (48)
  • Self test (57)
  • Self test (58)
  • Self test (72)
  • Self test (73)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • ...
406915-649275
325 if( (pRec->flags & MEM_Real)==0 ){
(pRec->flags & 0x0008)==0Description
TRUEevaluated 341820 times by 333 tests
Evaluated by:
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • Self test (127)
  • Self test (128)
  • Self test (129)
  • Self test (130)
  • ...
FALSEevaluated 65095 times by 4 tests
Evaluated by:
  • Self test
  • Self test (438)
  • Self test (57)
  • Self test (58)
65095-341820
326 if( pRec->flags & MEM_Str ) applyNumericAffinity(pRec,1);
executed 5247 times by 1 test: applyNumericAffinity(pRec,1);
Executed by:
  • Self test (438)
pRec->flags & 0x0002Description
TRUEevaluated 5247 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 336573 times by 333 tests
Evaluated by:
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • Self test (127)
  • Self test (128)
  • Self test (129)
  • Self test (130)
  • ...
5247-336573
327 }else{
executed 341820 times by 333 tests: end of block
Executed by:
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • Self test (127)
  • Self test (128)
  • Self test (129)
  • Self test (130)
  • ...
341820
328 sqlite3VdbeIntegerAffinity(pRec);-
329 }
executed 65095 times by 4 tests: end of block
Executed by:
  • Self test
  • Self test (438)
  • Self test (57)
  • Self test (58)
65095
330 }-
331 }else if( affinity==SQLITE_AFF_TEXT ){
executed 1056190 times by 363 tests: end of block
Executed by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • ...
affinity=='B'Description
TRUEevaluated 388680 times by 31 tests
Evaluated by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (42)
  • Self test (438)
  • Self test (44)
  • Self test (46)
  • Self test (47)
  • Self test (48)
  • Self test (57)
  • Self test (58)
  • Self test (72)
  • Self test (73)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • ...
FALSEevaluated 15013 times by 1 test
Evaluated by:
  • Self test (438)
15013-1056190
332 /* Only attempt the conversion to TEXT if there is an integer or real-
333 ** representation (blob and NULL do not get converted) but no string-
334 ** representation. It would be harmless to repeat the conversion if -
335 ** there is already a string rep, but it is pointless to waste those-
336 ** CPU cycles. */-
337 if( 0==(pRec->flags&MEM_Str) ){ /*OPTIMIZATION-IF-FALSE*/
0==(pRec->flags&0x0002)Description
TRUEevaluated 149637 times by 13 tests
Evaluated by:
  • Self test (100)
  • Self test (32)
  • Self test (33)
  • Self test (438)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
FALSEevaluated 239043 times by 31 tests
Evaluated by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (42)
  • Self test (438)
  • Self test (44)
  • Self test (46)
  • Self test (47)
  • Self test (48)
  • Self test (57)
  • Self test (58)
  • Self test (72)
  • Self test (73)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • ...
149637-239043
338 if( (pRec->flags&(MEM_Real|MEM_Int)) ){
(pRec->flags&(0x0008|0x0004))Description
TRUEevaluated 147272 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 2365 times by 13 tests
Evaluated by:
  • Self test (100)
  • Self test (32)
  • Self test (33)
  • Self test (438)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
2365-147272
339 sqlite3VdbeMemStringify(pRec, enc, 1);-
340 }
executed 147272 times by 1 test: end of block
Executed by:
  • Self test (438)
147272
341 }
executed 149637 times by 13 tests: end of block
Executed by:
  • Self test (100)
  • Self test (32)
  • Self test (33)
  • Self test (438)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • Self test (97)
  • Self test (98)
  • Self test (99)
149637
342 pRec->flags &= ~(MEM_Real|MEM_Int);-
343 }
executed 388680 times by 31 tests: end of block
Executed by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (42)
  • Self test (438)
  • Self test (44)
  • Self test (46)
  • Self test (47)
  • Self test (48)
  • Self test (57)
  • Self test (58)
  • Self test (72)
  • Self test (73)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • ...
388680
344}
executed 1459883 times by 363 tests: end of block
Executed by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • ...
1459883
345-
346/*-
347** Try to convert the type of a function argument or a result column-
348** into a numeric representation. Use either INTEGER or REAL whichever-
349** is appropriate. But only do the conversion if it is possible without-
350** loss of information and return the revised type of the argument.-
351*/-
352int sqlite3_value_numeric_type(sqlite3_value *pVal){-
353 int eType = sqlite3_value_type(pVal);-
354 if( eType==SQLITE_TEXT ){
eType==3Description
TRUEevaluated 4000403 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 252504 times by 1 test
Evaluated by:
  • Self test (438)
252504-4000403
355 Mem *pMem = (Mem*)pVal;-
356 applyNumericAffinity(pMem, 0);-
357 eType = sqlite3_value_type(pVal);-
358 }
executed 4000403 times by 1 test: end of block
Executed by:
  • Self test (438)
4000403
359 return eType;
executed 4252907 times by 1 test: return eType;
Executed by:
  • Self test (438)
4252907
360}-
361-
362/*-
363** Exported version of applyAffinity(). This one works on sqlite3_value*, -
364** not the internal Mem* type.-
365*/-
366void sqlite3ValueApplyAffinity(-
367 sqlite3_value *pVal, -
368 u8 affinity, -
369 u8 enc-
370){-
371 applyAffinity((Mem *)pVal, affinity, enc);-
372}
executed 145921 times by 1 test: end of block
Executed by:
  • Self test (438)
145921
373-
374/*-
375** pMem currently only holds a string type (or maybe a BLOB that we can-
376** interpret as a string if we want to). Compute its corresponding-
377** numeric type, if has one. Set the pMem->u.r and pMem->u.i fields-
378** accordingly.-
379*/-
380static u16 SQLITE_NOINLINE computeNumericType(Mem *pMem){-
381 assert( (pMem->flags & (MEM_Int|MEM_Real))==0 );-
382 assert( (pMem->flags & (MEM_Str|MEM_Blob))!=0 );-
383 if( sqlite3AtoF(pMem->z, &pMem->u.r, pMem->n, pMem->enc)==0 ){
sqlite3AtoF(pM... pMem->enc)==0Description
TRUEevaluated 897 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1705 times by 1 test
Evaluated by:
  • Self test (438)
897-1705
384 return 0;
executed 897 times by 1 test: return 0;
Executed by:
  • Self test (438)
897
385 }-
386 if( sqlite3Atoi64(pMem->z, &pMem->u.i, pMem->n, pMem->enc)==0 ){
sqlite3Atoi64(... pMem->enc)==0Description
TRUEevaluated 1336 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 369 times by 1 test
Evaluated by:
  • Self test (438)
369-1336
387 return MEM_Int;
executed 1336 times by 1 test: return 0x0004;
Executed by:
  • Self test (438)
1336
388 }-
389 return MEM_Real;
executed 369 times by 1 test: return 0x0008;
Executed by:
  • Self test (438)
369
390}-
391-
392/*-
393** Return the numeric type for pMem, either MEM_Int or MEM_Real or both or-
394** none. -
395**-
396** Unlike applyNumericAffinity(), this routine does not modify pMem->flags.-
397** But it does set pMem->u.r and pMem->u.i appropriately.-
398*/-
399static u16 numericType(Mem *pMem){-
400 if( pMem->flags & (MEM_Int|MEM_Real) ){
pMem->flags & (0x0004|0x0008)Description
TRUEevaluated 15748132 times by 335 tests
Evaluated by:
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • Self test (127)
  • Self test (128)
  • Self test (129)
  • Self test (130)
  • ...
FALSEevaluated 3142 times by 1 test
Evaluated by:
  • Self test (438)
3142-15748132
401 return pMem->flags & (MEM_Int|MEM_Real);
executed 15748132 times by 335 tests: return pMem->flags & (0x0004|0x0008);
Executed by:
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • Self test (127)
  • Self test (128)
  • Self test (129)
  • Self test (130)
  • ...
15748132
402 }-
403 if( pMem->flags & (MEM_Str|MEM_Blob) ){
pMem->flags & (0x0002|0x0010)Description
TRUEevaluated 2602 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 540 times by 1 test
Evaluated by:
  • Self test (438)
540-2602
404 return computeNumericType(pMem);
executed 2602 times by 1 test: return computeNumericType(pMem);
Executed by:
  • Self test (438)
2602
405 }-
406 return 0;
executed 540 times by 1 test: return 0;
Executed by:
  • Self test (438)
540
407}-
408-
409#ifdef SQLITE_DEBUG-
410/*-
411** Write a nice string representation of the contents of cell pMem-
412** into buffer zBuf, length nBuf.-
413*/-
414void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf){-
415 char *zCsr = zBuf;-
416 int f = pMem->flags;-
417-
418 static const char *const encnames[] = {"(X)", "(8)", "(16LE)", "(16BE)"};-
419-
420 if( f&MEM_Blob ){-
421 int i;-
422 char c;-
423 if( f & MEM_Dyn ){-
424 c = 'z';-
425 assert( (f & (MEM_Static|MEM_Ephem))==0 );-
426 }else if( f & MEM_Static ){-
427 c = 't';-
428 assert( (f & (MEM_Dyn|MEM_Ephem))==0 );-
429 }else if( f & MEM_Ephem ){-
430 c = 'e';-
431 assert( (f & (MEM_Static|MEM_Dyn))==0 );-
432 }else{-
433 c = 's';-
434 }-
435 *(zCsr++) = c;-
436 sqlite3_snprintf(100, zCsr, "%d[", pMem->n);-
437 zCsr += sqlite3Strlen30(zCsr);-
438 for(i=0; i<16 && i<pMem->n; i++){-
439 sqlite3_snprintf(100, zCsr, "%02X", ((int)pMem->z[i] & 0xFF));-
440 zCsr += sqlite3Strlen30(zCsr);-
441 }-
442 for(i=0; i<16 && i<pMem->n; i++){-
443 char z = pMem->z[i];-
444 if( z<32 || z>126 ) *zCsr++ = '.';-
445 else *zCsr++ = z;-
446 }-
447 *(zCsr++) = ']';-
448 if( f & MEM_Zero ){-
449 sqlite3_snprintf(100, zCsr,"+%dz",pMem->u.nZero);-
450 zCsr += sqlite3Strlen30(zCsr);-
451 }-
452 *zCsr = '\0';-
453 }else if( f & MEM_Str ){-
454 int j, k;-
455 zBuf[0] = ' ';-
456 if( f & MEM_Dyn ){-
457 zBuf[1] = 'z';-
458 assert( (f & (MEM_Static|MEM_Ephem))==0 );-
459 }else if( f & MEM_Static ){-
460 zBuf[1] = 't';-
461 assert( (f & (MEM_Dyn|MEM_Ephem))==0 );-
462 }else if( f & MEM_Ephem ){-
463 zBuf[1] = 'e';-
464 assert( (f & (MEM_Static|MEM_Dyn))==0 );-
465 }else{-
466 zBuf[1] = 's';-
467 }-
468 k = 2;-
469 sqlite3_snprintf(100, &zBuf[k], "%d", pMem->n);-
470 k += sqlite3Strlen30(&zBuf[k]);-
471 zBuf[k++] = '[';-
472 for(j=0; j<15 && j<pMem->n; j++){-
473 u8 c = pMem->z[j];-
474 if( c>=0x20 && c<0x7f ){-
475 zBuf[k++] = c;-
476 }else{-
477 zBuf[k++] = '.';-
478 }-
479 }-
480 zBuf[k++] = ']';-
481 sqlite3_snprintf(100,&zBuf[k], encnames[pMem->enc]);-
482 k += sqlite3Strlen30(&zBuf[k]);-
483 zBuf[k++] = 0;-
484 }-
485}-
486#endif-
487-
488#ifdef SQLITE_DEBUG-
489/*-
490** Print the value of a register for tracing purposes:-
491*/-
492static void memTracePrint(Mem *p){-
493 if( p->flags & MEM_Undefined ){-
494 printf(" undefined");-
495 }else if( p->flags & MEM_Null ){-
496 printf(p->flags & MEM_Zero ? " NULL-nochng" : " NULL");-
497 }else if( (p->flags & (MEM_Int|MEM_Str))==(MEM_Int|MEM_Str) ){-
498 printf(" si:%lld", p->u.i);-
499 }else if( p->flags & MEM_Int ){-
500 printf(" i:%lld", p->u.i);-
501#ifndef SQLITE_OMIT_FLOATING_POINT-
502 }else if( p->flags & MEM_Real ){-
503 printf(" r:%g", p->u.r);-
504#endif-
505 }else if( sqlite3VdbeMemIsRowSet(p) ){-
506 printf(" (rowset)");-
507 }else{-
508 char zBuf[200];-
509 sqlite3VdbeMemPrettyPrint(p, zBuf);-
510 printf(" %s", zBuf);-
511 }-
512 if( p->flags & MEM_Subtype ) printf(" subtype=0x%02x", p->eSubtype);-
513}-
514static void registerTrace(int iReg, Mem *p){-
515 printf("REG[%d] = ", iReg);-
516 memTracePrint(p);-
517 printf("\n");-
518 sqlite3VdbeCheckMemInvariants(p);-
519}-
520#endif-
521-
522#ifdef SQLITE_DEBUG-
523# define REGISTER_TRACE(R,M) if(db->flags&SQLITE_VdbeTrace)registerTrace(R,M)-
524#else-
525# define REGISTER_TRACE(R,M)-
526#endif-
527-
528-
529#ifdef VDBE_PROFILE-
530-
531/* -
532** hwtime.h contains inline assembler code for implementing -
533** high-performance timing routines.-
534*/-
535#include "hwtime.h"-
536-
537#endif-
538-
539#ifndef NDEBUG-
540/*-
541** This function is only called from within an assert() expression. It-
542** checks that the sqlite3.nTransaction variable is correctly set to-
543** the number of non-transaction savepoints currently in the -
544** linked list starting at sqlite3.pSavepoint.-
545** -
546** Usage:-
547**-
548** assert( checkSavepointCount(db) );-
549*/-
550static int checkSavepointCount(sqlite3 *db){-
551 int n = 0;-
552 Savepoint *p;-
553 for(p=db->pSavepoint; p; p=p->pNext) n++;-
554 assert( n==(db->nSavepoint + db->isTransactionSavepoint) );-
555 return 1;-
556}-
557#endif-
558-
559/*-
560** Return the register of pOp->p2 after first preparing it to be-
561** overwritten with an integer value.-
562*/-
563static SQLITE_NOINLINE Mem *out2PrereleaseWithClear(Mem *pOut){-
564 sqlite3VdbeMemSetNull(pOut);-
565 pOut->flags = MEM_Int;-
566 return pOut;
executed 12633 times by 1 test: return pOut;
Executed by:
  • Self test (438)
12633
567}-
568static Mem *out2Prerelease(Vdbe *p, VdbeOp *pOp){-
569 Mem *pOut;-
570 assert( pOp->p2>0 );-
571 assert( pOp->p2<=(p->nMem+1 - p->nCursor) );-
572 pOut = &p->aMem[pOp->p2];-
573 memAboutToChange(p, pOut);-
574 if( VdbeMemDynamic(pOut) ){ /*OPTIMIZATION-IF-FALSE*/
(((pOut)->flag...0|0x0400))!=0)Description
TRUEevaluated 12633 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 15847728 times by 425 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
12633-15847728
575 return out2PrereleaseWithClear(pOut);
executed 12633 times by 1 test: return out2PrereleaseWithClear(pOut);
Executed by:
  • Self test (438)
12633
576 }else{-
577 pOut->flags = MEM_Int;-
578 return pOut;
executed 15847728 times by 425 tests: return pOut;
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
15847728
579 }-
580}-
581-
582-
583/*-
584** Execute as much of a VDBE program as we can.-
585** This is the core of sqlite3_step(). -
586*/-
587int sqlite3VdbeExec(-
588 Vdbe *p /* The VDBE */-
589){-
590 Op *aOp = p->aOp; /* Copy of p->aOp */-
591 Op *pOp = aOp; /* Current operation */-
592#if defined(SQLITE_DEBUG) || defined(VDBE_PROFILE)-
593 Op *pOrigOp; /* Value of pOp at the top of the loop */-
594#endif-
595#ifdef SQLITE_DEBUG-
596 int nExtraDelete = 0; /* Verifies FORDELETE and AUXDELETE flags */-
597#endif-
598 int rc = SQLITE_OK; /* Value to return */-
599 sqlite3 *db = p->db; /* The database */-
600 u8 resetSchemaOnFault = 0; /* Reset schema after an error if positive */-
601 u8 encoding = ENC(db); /* The database encoding */-
602 int iCompare = 0; /* Result of last comparison */-
603 unsigned nVmStep = 0; /* Number of virtual machine steps */-
604#ifndef SQLITE_OMIT_PROGRESS_CALLBACK-
605 unsigned nProgressLimit; /* Invoke xProgress() when nVmStep reaches this */-
606#endif-
607 Mem *aMem = p->aMem; /* Copy of p->aMem */-
608 Mem *pIn1 = 0; /* 1st input operand */-
609 Mem *pIn2 = 0; /* 2nd input operand */-
610 Mem *pIn3 = 0; /* 3rd input operand */-
611 Mem *pOut = 0; /* Output operand */-
612#ifdef VDBE_PROFILE-
613 u64 start; /* CPU clock count at start of opcode */-
614#endif-
615 /*** INSERT STACK UNION HERE ***/-
616-
617 assert( p->magic==VDBE_MAGIC_RUN ); /* sqlite3_step() verifies this */-
618 sqlite3VdbeEnter(p);-
619 if( p->rc==SQLITE_NOMEM ){
p->rc==7Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 3754154 times by 435 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
7-3754154
620 /* This happens if a malloc() inside a call to sqlite3_column_text() or-
621 ** sqlite3_column_text16() failed. */-
622 goto no_mem;
executed 7 times by 1 test: goto no_mem;
Executed by:
  • Self test (438)
7
623 }-
624 assert( p->rc==SQLITE_OK || (p->rc&0xff)==SQLITE_BUSY );-
625 assert( p->bIsReader || p->readOnly!=0 );-
626 p->iCurrentTime = 0;-
627 assert( p->explain==0 );-
628 p->pResultSet = 0;-
629 db->busyHandler.nBusy = 0;-
630 if( db->u1.isInterrupted ) goto abort_due_to_interrupt;
executed 73 times by 1 test: goto abort_due_to_interrupt;
Executed by:
  • Self test (438)
db->u1.isInterruptedDescription
TRUEevaluated 73 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 3754081 times by 435 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
73-3754081
631 sqlite3VdbeIOTraceSql(p);-
632#ifndef SQLITE_OMIT_PROGRESS_CALLBACK-
633 if( db->xProgress ){
db->xProgressDescription
TRUEevaluated 33 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 3754048 times by 435 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
33-3754048
634 u32 iPrior = p->aCounter[SQLITE_STMTSTATUS_VM_STEP];-
635 assert( 0 < db->nProgressOps );-
636 nProgressLimit = db->nProgressOps - (iPrior % db->nProgressOps);-
637 }else{
executed 33 times by 1 test: end of block
Executed by:
  • Self test (438)
33
638 nProgressLimit = 0xffffffff;-
639 }
executed 3754048 times by 435 tests: end of block
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
3754048
640#endif-
641#ifdef SQLITE_DEBUG-
642 sqlite3BeginBenignMalloc();-
643 if( p->pc==0-
644 && (p->db->flags & (SQLITE_VdbeListing|SQLITE_VdbeEQP|SQLITE_VdbeTrace))!=0-
645 ){-
646 int i;-
647 int once = 1;-
648 sqlite3VdbePrintSql(p);-
649 if( p->db->flags & SQLITE_VdbeListing ){-
650 printf("VDBE Program Listing:\n");-
651 for(i=0; i<p->nOp; i++){-
652 sqlite3VdbePrintOp(stdout, i, &aOp[i]);-
653 }-
654 }-
655 if( p->db->flags & SQLITE_VdbeEQP ){-
656 for(i=0; i<p->nOp; i++){-
657 if( aOp[i].opcode==OP_Explain ){-
658 if( once ) printf("VDBE Query Plan:\n");-
659 printf("%s\n", aOp[i].p4.z);-
660 once = 0;-
661 }-
662 }-
663 }-
664 if( p->db->flags & SQLITE_VdbeTrace ) printf("VDBE Trace:\n");-
665 }-
666 sqlite3EndBenignMalloc();-
667#endif-
668 for(pOp=&aOp[p->pc]; 1; pOp++){
1Description
TRUEevaluated 182117017 times by 435 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
FALSEnever evaluated
0-182117017
669 /* Errors are detected by individual opcodes, with an immediate-
670 ** jumps to abort_due_to_error. */-
671 assert( rc==SQLITE_OK );-
672-
673 assert( pOp>=aOp && pOp<&aOp[p->nOp]);-
674#ifdef VDBE_PROFILE-
675 start = sqlite3NProfileCnt ? sqlite3NProfileCnt : sqlite3Hwtime();-
676#endif-
677 nVmStep++;-
678#ifdef SQLITE_ENABLE_STMT_SCANSTATUS-
679 if( p->anExec ) p->anExec[(int)(pOp-aOp)]++;-
680#endif-
681-
682 /* Only allow tracing if SQLITE_DEBUG is defined.-
683 */-
684#ifdef SQLITE_DEBUG-
685 if( db->flags & SQLITE_VdbeTrace ){-
686 sqlite3VdbePrintOp(stdout, (int)(pOp - aOp), pOp);-
687 }-
688#endif-
689 -
690-
691 /* Check to see if we need to simulate an interrupt. This only happens-
692 ** if we have a special test build.-
693 */-
694#ifdef SQLITE_TEST-
695 if( sqlite3_interrupt_count>0 ){
sqlite3_interrupt_count>0Description
TRUEevaluated 1593078 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 180523939 times by 435 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
1593078-180523939
696 sqlite3_interrupt_count--;-
697 if( sqlite3_interrupt_count==0 ){
sqlite3_interrupt_count==0Description
TRUEevaluated 2125 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1590953 times by 1 test
Evaluated by:
  • Self test (438)
2125-1590953
698 sqlite3_interrupt(db);-
699 }
executed 2125 times by 1 test: end of block
Executed by:
  • Self test (438)
2125
700 }
executed 1593078 times by 1 test: end of block
Executed by:
  • Self test (438)
1593078
701#endif-
702-
703 /* Sanity checking on other operands */-
704#ifdef SQLITE_DEBUG-
705 {-
706 u8 opProperty = sqlite3OpcodeProperty[pOp->opcode];-
707 if( (opProperty & OPFLG_IN1)!=0 ){-
708 assert( pOp->p1>0 );-
709 assert( pOp->p1<=(p->nMem+1 - p->nCursor) );-
710 assert( memIsValid(&aMem[pOp->p1]) );-
711 assert( sqlite3VdbeCheckMemInvariants(&aMem[pOp->p1]) );-
712 REGISTER_TRACE(pOp->p1, &aMem[pOp->p1]);-
713 }-
714 if( (opProperty & OPFLG_IN2)!=0 ){-
715 assert( pOp->p2>0 );-
716 assert( pOp->p2<=(p->nMem+1 - p->nCursor) );-
717 assert( memIsValid(&aMem[pOp->p2]) );-
718 assert( sqlite3VdbeCheckMemInvariants(&aMem[pOp->p2]) );-
719 REGISTER_TRACE(pOp->p2, &aMem[pOp->p2]);-
720 }-
721 if( (opProperty & OPFLG_IN3)!=0 ){-
722 assert( pOp->p3>0 );-
723 assert( pOp->p3<=(p->nMem+1 - p->nCursor) );-
724 assert( memIsValid(&aMem[pOp->p3]) );-
725 assert( sqlite3VdbeCheckMemInvariants(&aMem[pOp->p3]) );-
726 REGISTER_TRACE(pOp->p3, &aMem[pOp->p3]);-
727 }-
728 if( (opProperty & OPFLG_OUT2)!=0 ){-
729 assert( pOp->p2>0 );-
730 assert( pOp->p2<=(p->nMem+1 - p->nCursor) );-
731 memAboutToChange(p, &aMem[pOp->p2]);-
732 }-
733 if( (opProperty & OPFLG_OUT3)!=0 ){-
734 assert( pOp->p3>0 );-
735 assert( pOp->p3<=(p->nMem+1 - p->nCursor) );-
736 memAboutToChange(p, &aMem[pOp->p3]);-
737 }-
738 }-
739#endif-
740#if defined(SQLITE_DEBUG) || defined(VDBE_PROFILE)-
741 pOrigOp = pOp;-
742#endif-
743 -
744 switch( pOp->opcode ){-
745-
746/*****************************************************************************-
747** What follows is a massive switch statement where each case implements a-
748** separate instruction in the virtual machine. If we follow the usual-
749** indentation conventions, each case should be indented by 6 spaces. But-
750** that is a lot of wasted space on the left margin. So the code within-
751** the switch statement will break with convention and be flush-left. Another-
752** big comment (similar to this one) will mark the point in the code where-
753** we transition back to normal indentation.-
754**-
755** The formatting of each case is important. The makefile for SQLite-
756** generates two C files "opcodes.h" and "opcodes.c" by scanning this-
757** file looking for lines that begin with "case OP_". The opcodes.h files-
758** will be filled with #defines that give unique integer values to each-
759** opcode and the opcodes.c file is filled with an array of strings where-
760** each string is the symbolic name for the corresponding opcode. If the-
761** case statement is followed by a comment of the form "/# same as ... #/"-
762** that comment is used to determine the particular value of the opcode.-
763**-
764** Other keywords in the comment that follows each case are used to-
765** construct the OPFLG_INITIALIZER value that initializes opcodeProperty[].-
766** Keywords include: in1, in2, in3, out2, out3. See-
767** the mkopcodeh.awk script for additional information.-
768**-
769** Documentation about VDBE opcodes is generated by scanning this file-
770** for lines of that contain "Opcode:". That line and all subsequent-
771** comment lines are used in the generation of the opcode.html documentation-
772** file.-
773**-
774** SUMMARY:-
775**-
776** Formatting is important to scripts that scan this file.-
777** Do not deviate from the formatting style currently in use.-
778**-
779*****************************************************************************/-
780-
781/* Opcode: Goto * P2 * * *-
782**-
783** An unconditional jump to address P2.-
784** The next instruction executed will be -
785** the one at index P2 from the beginning of-
786** the program.-
787**-
788** The P1 parameter is not actually used by this opcode. However, it-
789** is sometimes set to 1 instead of 0 as a hint to the command-line shell-
790** that this Goto is the bottom of a loop and that the lines from P2 down-
791** to the current line should be indented for EXPLAIN output.-
792*/-
793case
executed 6426550 times by 435 tests: case 11:
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
OP_Goto: { /* jump */
executed 6426550 times by 435 tests: case 11:
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
6426550
794jump_to_p2_and_check_for_interrupt:-
795 pOp = &aOp[pOp->p2 - 1];-
796-
797 /* Opcodes that are used as the bottom of a loop (OP_Next, OP_Prev,-
798 ** OP_VNext, or OP_SorterNext) all jump here upon-
799 ** completion. Check to see if sqlite3_interrupt() has been called-
800 ** or if the progress callback needs to be invoked. -
801 **-
802 ** This code uses unstructured "goto" statements and does not look clean.-
803 ** But that is not due to sloppy coding habits. The code is written this-
804 ** way for performance, to avoid having to run the interrupt and progress-
805 ** checks on every opcode. This helps sqlite3_step() to run about 1.5%-
806 ** faster according to "valgrind --tool=cachegrind" */-
807check_for_interrupt:
code before this statement executed 30361641 times by 435 tests: check_for_interrupt:
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
30361641
808 if( db->u1.isInterrupted ) goto abort_due_to_interrupt;
executed 2037 times by 1 test: goto abort_due_to_interrupt;
Executed by:
  • Self test (438)
db->u1.isInterruptedDescription
TRUEevaluated 2037 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 30756026 times by 435 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
2037-30756026
809#ifndef SQLITE_OMIT_PROGRESS_CALLBACK-
810 /* Call the progress callback if it is configured and the required number-
811 ** of VDBE ops have been executed (either since this invocation of-
812 ** sqlite3VdbeExec() or since last time the progress callback was called).-
813 ** If the progress callback returns non-zero, exit the virtual machine with-
814 ** a return code SQLITE_ABORT.-
815 */-
816 if( nVmStep>=nProgressLimit && db->xProgress!=0 ){
nVmStep>=nProgressLimitDescription
TRUEevaluated 46 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 30755980 times by 435 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
db->xProgress!=0Description
TRUEevaluated 40 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 6 times by 1 test
Evaluated by:
  • Self test (438)
6-30755980
817 assert( db->nProgressOps!=0 );-
818 nProgressLimit = nVmStep + db->nProgressOps - (nVmStep%db->nProgressOps);-
819 if( db->xProgress(db->pProgressArg) ){
db->xProgress(...>pProgressArg)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 36 times by 1 test
Evaluated by:
  • Self test (438)
4-36
820 rc = SQLITE_INTERRUPT;-
821 goto abort_due_to_error;
executed 4 times by 1 test: goto abort_due_to_error;
Executed by:
  • Self test (438)
4
822 }-
823 }
executed 36 times by 1 test: end of block
Executed by:
  • Self test (438)
36
824#endif-
825 -
826 break;
executed 30756022 times by 435 tests: break;
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
30756022
827}-
828-
829/* Opcode: Gosub P1 P2 * * *-
830**-
831** Write the current address onto register P1-
832** and then jump to address P2.-
833*/-
834case
executed 545027 times by 1 test: case 12:
Executed by:
  • Self test (438)
OP_Gosub: { /* jump */
executed 545027 times by 1 test: case 12:
Executed by:
  • Self test (438)
545027
835 assert( pOp->p1>0 && pOp->p1<=(p->nMem+1 - p->nCursor) );-
836 pIn1 = &aMem[pOp->p1];-
837 assert( VdbeMemDynamic(pIn1)==0 );-
838 memAboutToChange(p, pIn1);-
839 pIn1->flags = MEM_Int;-
840 pIn1->u.i = (int)(pOp-aOp);-
841 REGISTER_TRACE(pOp->p1, pIn1);-
842-
843 /* Most jump operations do a goto to this spot in order to update-
844 ** the pOp pointer. */-
845jump_to_p2:
code before this statement executed 545027 times by 1 test: jump_to_p2:
Executed by:
  • Self test (438)
545027
846 pOp = &aOp[pOp->p2 - 1];-
847 break;
executed 12709055 times by 435 tests: break;
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
12709055
848}-
849-
850/* Opcode: Return P1 * * * *-
851**-
852** Jump to the next instruction after the address in register P1. After-
853** the jump, register P1 becomes undefined.-
854*/-
855case
executed 549440 times by 1 test: case 66:
Executed by:
  • Self test (438)
OP_Return: { /* in1 */
executed 549440 times by 1 test: case 66:
Executed by:
  • Self test (438)
549440
856 pIn1 = &aMem[pOp->p1];-
857 assert( pIn1->flags==MEM_Int );-
858 pOp = &aOp[pIn1->u.i];-
859 pIn1->flags = MEM_Undefined;-
860 break;
executed 549440 times by 1 test: break;
Executed by:
  • Self test (438)
549440
861}-
862-
863/* Opcode: InitCoroutine P1 P2 P3 * *-
864**-
865** Set up register P1 so that it will Yield to the coroutine-
866** located at address P3.-
867**-
868** If P2!=0 then the coroutine implementation immediately follows-
869** this opcode. So jump over the coroutine implementation to-
870** address P2.-
871**-
872** See also: EndCoroutine-
873*/-
874case
executed 97343 times by 9 tests: case 13:
Executed by:
  • Self test
  • Self test (101)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (438)
  • Self test (57)
  • Self test (58)
  • Self test (64)
OP_InitCoroutine: { /* jump */
executed 97343 times by 9 tests: case 13:
Executed by:
  • Self test
  • Self test (101)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (438)
  • Self test (57)
  • Self test (58)
  • Self test (64)
97343
875 assert( pOp->p1>0 && pOp->p1<=(p->nMem+1 - p->nCursor) );-
876 assert( pOp->p2>=0 && pOp->p2<p->nOp );-
877 assert( pOp->p3>=0 && pOp->p3<p->nOp );-
878 pOut = &aMem[pOp->p1];-
879 assert( !VdbeMemDynamic(pOut) );-
880 pOut->u.i = pOp->p3 - 1;-
881 pOut->flags = MEM_Int;-
882 if( pOp->p2 ) goto jump_to_p2;
executed 52402 times by 9 tests: goto jump_to_p2;
Executed by:
  • Self test
  • Self test (101)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (438)
  • Self test (57)
  • Self test (58)
  • Self test (64)
pOp->p2Description
TRUEevaluated 52402 times by 9 tests
Evaluated by:
  • Self test
  • Self test (101)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (438)
  • Self test (57)
  • Self test (58)
  • Self test (64)
FALSEevaluated 44941 times by 1 test
Evaluated by:
  • Self test (438)
44941-52402
883 break;
executed 44941 times by 1 test: break;
Executed by:
  • Self test (438)
44941
884}-
885-
886/* Opcode: EndCoroutine P1 * * * *-
887**-
888** The instruction at the address in register P1 is a Yield.-
889** Jump to the P2 parameter of that Yield.-
890** After the jump, register P1 becomes undefined.-
891**-
892** See also: InitCoroutine-
893*/-
894case
executed 14467 times by 9 tests: case 67:
Executed by:
  • Self test
  • Self test (101)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (438)
  • Self test (57)
  • Self test (58)
  • Self test (64)
OP_EndCoroutine: { /* in1 */
executed 14467 times by 9 tests: case 67:
Executed by:
  • Self test
  • Self test (101)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (438)
  • Self test (57)
  • Self test (58)
  • Self test (64)
14467
895 VdbeOp *pCaller;-
896 pIn1 = &aMem[pOp->p1];-
897 assert( pIn1->flags==MEM_Int );-
898 assert( pIn1->u.i>=0 && pIn1->u.i<p->nOp );-
899 pCaller = &aOp[pIn1->u.i];-
900 assert( pCaller->opcode==OP_Yield );-
901 assert( pCaller->p2>=0 && pCaller->p2<p->nOp );-
902 pOp = &aOp[pCaller->p2 - 1];-
903 pIn1->flags = MEM_Undefined;-
904 break;
executed 14467 times by 9 tests: break;
Executed by:
  • Self test
  • Self test (101)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (438)
  • Self test (57)
  • Self test (58)
  • Self test (64)
14467
905}-
906-
907/* Opcode: Yield P1 P2 * * *-
908**-
909** Swap the program counter with the value in register P1. This-
910** has the effect of yielding to a coroutine.-
911**-
912** If the coroutine that is launched by this instruction ends with-
913** Yield or Return then continue to the next instruction. But if-
914** the coroutine launched by this instruction ends with-
915** EndCoroutine, then jump to P2 rather than continuing with the-
916** next instruction.-
917**-
918** See also: InitCoroutine-
919*/-
920case
executed 7816689 times by 9 tests: case 14:
Executed by:
  • Self test
  • Self test (101)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (438)
  • Self test (57)
  • Self test (58)
  • Self test (64)
OP_Yield: { /* in1, jump */
executed 7816689 times by 9 tests: case 14:
Executed by:
  • Self test
  • Self test (101)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (438)
  • Self test (57)
  • Self test (58)
  • Self test (64)
7816689
921 int pcDest;-
922 pIn1 = &aMem[pOp->p1];-
923 assert( VdbeMemDynamic(pIn1)==0 );-
924 pIn1->flags = MEM_Int;-
925 pcDest = (int)pIn1->u.i;-
926 pIn1->u.i = (int)(pOp - aOp);-
927 REGISTER_TRACE(pOp->p1, pIn1);-
928 pOp = &aOp[pcDest];-
929 break;
executed 7816689 times by 9 tests: break;
Executed by:
  • Self test
  • Self test (101)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (438)
  • Self test (57)
  • Self test (58)
  • Self test (64)
7816689
930}-
931-
932/* Opcode: HaltIfNull P1 P2 P3 P4 P5-
933** Synopsis: if r[P3]=null halt-
934**-
935** Check the value in register P3. If it is NULL then Halt using-
936** parameter P1, P2, and P4 as if this were a Halt instruction. If the-
937** value in register P3 is not NULL, then this routine is a no-op.-
938** The P5 parameter should be 1.-
939*/-
940case
executed 23473 times by 1 test: case 68:
Executed by:
  • Self test (438)
OP_HaltIfNull: { /* in3 */
executed 23473 times by 1 test: case 68:
Executed by:
  • Self test (438)
23473
941 pIn3 = &aMem[pOp->p3];-
942#ifdef SQLITE_DEBUG-
943 if( pOp->p2==OE_Abort ){ sqlite3VdbeAssertAbortable(p); }-
944#endif-
945 if( (pIn3->flags & MEM_Null)==0 ) break;
executed 23413 times by 1 test: break;
Executed by:
  • Self test (438)
(pIn3->flags & 0x0001)==0Description
TRUEevaluated 23413 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 60 times by 1 test
Evaluated by:
  • Self test (438)
60-23413
946 /* Fall through into OP_Halt */-
947}-
948-
949/* Opcode: Halt P1 P2 * P4 P5-
950**-
951** Exit immediately. All open cursors, etc are closed-
952** automatically.-
953**-
954** P1 is the result code returned by sqlite3_exec(), sqlite3_reset(),-
955** or sqlite3_finalize(). For a normal halt, this should be SQLITE_OK (0).-
956** For errors, it can be some other value. If P1!=0 then P2 will determine-
957** whether or not to rollback the current transaction. Do not rollback-
958** if P2==OE_Fail. Do the rollback if P2==OE_Rollback. If P2==OE_Abort,-
959** then back out all changes that have occurred during this execution of the-
960** VDBE, but do not rollback the transaction. -
961**-
962** If P4 is not null then it is an error message string.-
963**-
964** P5 is a value between 0 and 4, inclusive, that modifies the P4 string.-
965**-
966** 0: (no change)-
967** 1: NOT NULL contraint failed: P4-
968** 2: UNIQUE constraint failed: P4-
969** 3: CHECK constraint failed: P4-
970** 4: FOREIGN KEY constraint failed: P4-
971**-
972** If P5 is not zero and P4 is NULL, then everything after the ":" is-
973** omitted.-
974**-
975** There is an implied "Halt 0 0 0" instruction inserted at the very end of-
976** every program. So a jump past the last instruction of the program-
977** is the same as executing Halt.-
978*/-
979case
code before this statement executed 60 times by 1 test: case 69:
Executed by:
  • Self test (438)
executed 1179804 times by 435 tests: case 69:
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
OP_Halt: {
code before this statement executed 60 times by 1 test: case 69:
Executed by:
  • Self test (438)
executed 1179804 times by 435 tests: case 69:
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
60-1179804
980 VdbeFrame *pFrame;-
981 int pcx;-
982-
983 pcx = (int)(pOp - aOp);-
984#ifdef SQLITE_DEBUG-
985 if( pOp->p2==OE_Abort ){ sqlite3VdbeAssertAbortable(p); }-
986#endif-
987 if( pOp->p1==SQLITE_OK && p->pFrame ){
pOp->p1==0Description
TRUEevaluated 1179295 times by 435 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
FALSEevaluated 569 times by 1 test
Evaluated by:
  • Self test (438)
p->pFrameDescription
TRUEevaluated 134479 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1044816 times by 435 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
569-1179295
988 /* Halt the sub-program. Return control to the parent frame. */-
989 pFrame = p->pFrame;-
990 p->pFrame = pFrame->pParent;-
991 p->nFrame--;-
992 sqlite3VdbeSetChanges(db, p->nChange);-
993 pcx = sqlite3VdbeFrameRestore(pFrame);-
994 if( pOp->p2==OE_Ignore ){
pOp->p2==4Description
TRUEevaluated 124857 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 9622 times by 1 test
Evaluated by:
  • Self test (438)
9622-124857
995 /* Instruction pcx is the OP_Program that invoked the sub-program -
996 ** currently being halted. If the p2 instruction of this OP_Halt-
997 ** instruction is set to OE_Ignore, then the sub-program is throwing-
998 ** an IGNORE exception. In this case jump to the address specified-
999 ** as the p2 of the calling OP_Program. */-
1000 pcx = p->aOp[pcx].p2-1;-
1001 }
executed 124857 times by 1 test: end of block
Executed by:
  • Self test (438)
124857
1002 aOp = p->aOp;-
1003 aMem = p->aMem;-
1004 pOp = &aOp[pcx];-
1005 break;
executed 134479 times by 1 test: break;
Executed by:
  • Self test (438)
134479
1006 }-
1007 p->rc = pOp->p1;-
1008 p->errorAction = (u8)pOp->p2;-
1009 p->pc = pcx;-
1010 assert( pOp->p5<=4 );-
1011 if( p->rc ){
p->rcDescription
TRUEevaluated 569 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1044816 times by 435 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
569-1044816
1012 if( pOp->p5 ){
pOp->p5Description
TRUEevaluated 546 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 23 times by 1 test
Evaluated by:
  • Self test (438)
23-546
1013 static const char * const azType[] = { "NOT NULL", "UNIQUE", "CHECK",-
1014 "FOREIGN KEY" };-
1015 testcase( pOp->p5==1 );-
1016 testcase( pOp->p5==2 );-
1017 testcase( pOp->p5==3 );-
1018 testcase( pOp->p5==4 );-
1019 sqlite3VdbeError(p, "%s constraint failed", azType[pOp->p5-1]);-
1020 if( pOp->p4.z ){
pOp->p4.zDescription
TRUEevaluated 446 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 100 times by 1 test
Evaluated by:
  • Self test (438)
100-446
1021 p->zErrMsg = sqlite3MPrintf(db, "%z: %s", p->zErrMsg, pOp->p4.z);-
1022 }
executed 446 times by 1 test: end of block
Executed by:
  • Self test (438)
446
1023 }else{
executed 546 times by 1 test: end of block
Executed by:
  • Self test (438)
546
1024 sqlite3VdbeError(p, "%s", pOp->p4.z);-
1025 }
executed 23 times by 1 test: end of block
Executed by:
  • Self test (438)
23
1026 sqlite3_log(pOp->p1, "abort at %d in [%s]: %s", pcx, p->zSql, p->zErrMsg);-
1027 }
executed 569 times by 1 test: end of block
Executed by:
  • Self test (438)
569
1028 rc = sqlite3VdbeHalt(p);-
1029 assert( rc==SQLITE_BUSY || rc==SQLITE_OK || rc==SQLITE_ERROR );-
1030 if( rc==SQLITE_BUSY ){
rc==5Description
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • Self test (438)
  • Self test (55)
FALSEevaluated 1045273 times by 435 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
18-1045273
1031 p->rc = SQLITE_BUSY;-
1032 }else{
executed 18 times by 2 tests: end of block
Executed by:
  • Self test (438)
  • Self test (55)
18
1033 assert( rc==SQLITE_OK || (p->rc&0xff)==SQLITE_CONSTRAINT );-
1034 assert( rc==SQLITE_OK || db->nDeferredCons>0 || db->nDeferredImmCons>0 );-
1035 rc = p->rc ? SQLITE_ERROR : SQLITE_DONE;
p->rcDescription
TRUEevaluated 948 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1044325 times by 435 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
948-1044325
1036 }
executed 1045273 times by 435 tests: end of block
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
1045273
1037 goto vdbe_return;
executed 1045291 times by 435 tests: goto vdbe_return;
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
1045291
1038}-
1039-
1040/* Opcode: Integer P1 P2 * * *-
1041** Synopsis: r[P2]=P1-
1042**-
1043** The 32-bit integer value P1 is written into register P2.-
1044*/-
1045case
executed 2937853 times by 404 tests: case 70:
Executed by:
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • ...
OP_Integer: { /* out2 */
executed 2937853 times by 404 tests: case 70:
Executed by:
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • ...
2937853
1046 pOut = out2Prerelease(p, pOp);-
1047 pOut->u.i = pOp->p1;-
1048 break;
executed 2937853 times by 404 tests: break;
Executed by:
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • ...
2937853
1049}-
1050-
1051/* Opcode: Int64 * P2 * P4 *-
1052** Synopsis: r[P2]=P4-
1053**-
1054** P4 is a pointer to a 64-bit integer value.-
1055** Write that value into register P2.-
1056*/-
1057case
executed 12939 times by 4 tests: case 71:
Executed by:
  • Self test (32)
  • Self test (33)
  • Self test (438)
  • Self test (64)
OP_Int64: { /* out2 */
executed 12939 times by 4 tests: case 71:
Executed by:
  • Self test (32)
  • Self test (33)
  • Self test (438)
  • Self test (64)
12939
1058 pOut = out2Prerelease(p, pOp);-
1059 assert( pOp->p4.pI64!=0 );-
1060 pOut->u.i = *pOp->p4.pI64;-
1061 break;
executed 12939 times by 4 tests: break;
Executed by:
  • Self test (32)
  • Self test (33)
  • Self test (438)
  • Self test (64)
12939
1062}-
1063-
1064#ifndef SQLITE_OMIT_FLOATING_POINT-
1065/* Opcode: Real * P2 * P4 *-
1066** Synopsis: r[P2]=P4-
1067**-
1068** P4 is a pointer to a 64-bit floating point value.-
1069** Write that value into register P2.-
1070*/-
1071case
executed 39344 times by 1 test: case 141:
Executed by:
  • Self test (438)
OP_Real: { /* same as TK_FLOAT, out2 */
executed 39344 times by 1 test: case 141:
Executed by:
  • Self test (438)
39344
1072 pOut = out2Prerelease(p, pOp);-
1073 pOut->flags = MEM_Real;-
1074 assert( !sqlite3IsNaN(*pOp->p4.pReal) );-
1075 pOut->u.r = *pOp->p4.pReal;-
1076 break;
executed 39344 times by 1 test: break;
Executed by:
  • Self test (438)
39344
1077}-
1078#endif-
1079-
1080/* Opcode: String8 * P2 * P4 *-
1081** Synopsis: r[P2]='P4'-
1082**-
1083** P4 points to a nul terminated UTF-8 string. This opcode is transformed -
1084** into a String opcode before it is executed for the first time. During-
1085** this transformation, the length of string P4 is computed and stored-
1086** as the P1 parameter.-
1087*/-
1088case
executed 253113 times by 58 tests: case 106:
Executed by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (3)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (35)
  • Self test (38)
  • Self test (39)
  • Self test (4)
  • Self test (42)
  • Self test (43)
  • Self test (438)
  • Self test (44)
  • Self test (45)
  • Self test (46)
  • Self test (47)
  • ...
OP_String8: { /* same as TK_STRING, out2 */
executed 253113 times by 58 tests: case 106:
Executed by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (3)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (35)
  • Self test (38)
  • Self test (39)
  • Self test (4)
  • Self test (42)
  • Self test (43)
  • Self test (438)
  • Self test (44)
  • Self test (45)
  • Self test (46)
  • Self test (47)
  • ...
253113
1089 assert( pOp->p4.z!=0 );-
1090 pOut = out2Prerelease(p, pOp);-
1091 pOp->opcode = OP_String;-
1092 pOp->p1 = sqlite3Strlen30(pOp->p4.z);-
1093-
1094#ifndef SQLITE_OMIT_UTF16-
1095 if( encoding!=SQLITE_UTF8 ){
encoding!=1Description
TRUEevaluated 488 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 252625 times by 58 tests
Evaluated by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (3)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (35)
  • Self test (38)
  • Self test (39)
  • Self test (4)
  • Self test (42)
  • Self test (43)
  • Self test (438)
  • Self test (44)
  • Self test (45)
  • Self test (46)
  • Self test (47)
  • ...
488-252625
1096 rc = sqlite3VdbeMemSetStr(pOut, pOp->p4.z, -1, SQLITE_UTF8, SQLITE_STATIC);-
1097 assert( rc==SQLITE_OK || rc==SQLITE_TOOBIG );-
1098 if( SQLITE_OK!=sqlite3VdbeChangeEncoding(pOut, encoding) ) goto no_mem;
never executed: goto no_mem;
0!=sqlite3Vdbe...Out, encoding)Description
TRUEnever evaluated
FALSEevaluated 488 times by 1 test
Evaluated by:
  • Self test (438)
0-488
1099 assert( pOut->szMalloc>0 && pOut->zMalloc==pOut->z );-
1100 assert( VdbeMemDynamic(pOut)==0 );-
1101 pOut->szMalloc = 0;-
1102 pOut->flags |= MEM_Static;-
1103 if( pOp->p4type==P4_DYNAMIC ){
pOp->p4type==(-7)Description
TRUEevaluated 486 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
2-486
1104 sqlite3DbFree(db, pOp->p4.z);-
1105 }
executed 486 times by 1 test: end of block
Executed by:
  • Self test (438)
486
1106 pOp->p4type = P4_DYNAMIC;-
1107 pOp->p4.z = pOut->z;-
1108 pOp->p1 = pOut->n;-
1109 }
executed 488 times by 1 test: end of block
Executed by:
  • Self test (438)
488
1110 testcase( rc==SQLITE_TOOBIG );-
1111#endif-
1112 if( pOp->p1>db->aLimit[SQLITE_LIMIT_LENGTH] ){
pOp->p1>db->aLimit[0]Description
TRUEnever evaluated
FALSEevaluated 253113 times by 58 tests
Evaluated by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (3)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (35)
  • Self test (38)
  • Self test (39)
  • Self test (4)
  • Self test (42)
  • Self test (43)
  • Self test (438)
  • Self test (44)
  • Self test (45)
  • Self test (46)
  • Self test (47)
  • ...
0-253113
1113 goto too_big;
never executed: goto too_big;
0
1114 }-
1115 assert( rc==SQLITE_OK );-
1116 /* Fall through to the next case, OP_String */-
1117}-
1118 -
1119/* Opcode: String P1 P2 P3 P4 P5-
1120** Synopsis: r[P2]='P4' (len=P1)-
1121**-
1122** The string value P4 of length P1 (bytes) is stored in register P2.-
1123**-
1124** If P3 is not zero and the content of register P3 is equal to P5, then-
1125** the datatype of the register P2 is converted to BLOB. The content is-
1126** the same sequence of bytes, it is merely interpreted as a BLOB instead-
1127** of a string, as if it had been CAST. In other words:-
1128**-
1129** if( P3!=0 and reg[P3]==P5 ) reg[P2] := CAST(reg[P2] as BLOB)-
1130*/-
1131case
code before this statement executed 253113 times by 58 tests: case 72:
Executed by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (3)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (35)
  • Self test (38)
  • Self test (39)
  • Self test (4)
  • Self test (42)
  • Self test (43)
  • Self test (438)
  • Self test (44)
  • Self test (45)
  • Self test (46)
  • Self test (47)
  • ...
executed 441644 times by 2 tests: case 72:
Executed by:
  • Self test (38)
  • Self test (438)
OP_String: { /* out2 */
code before this statement executed 253113 times by 58 tests: case 72:
Executed by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (3)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (35)
  • Self test (38)
  • Self test (39)
  • Self test (4)
  • Self test (42)
  • Self test (43)
  • Self test (438)
  • Self test (44)
  • Self test (45)
  • Self test (46)
  • Self test (47)
  • ...
executed 441644 times by 2 tests: case 72:
Executed by:
  • Self test (38)
  • Self test (438)
253113-441644
1132 assert( pOp->p4.z!=0 );-
1133 pOut = out2Prerelease(p, pOp);-
1134 pOut->flags = MEM_Str|MEM_Static|MEM_Term;-
1135 pOut->z = pOp->p4.z;-
1136 pOut->n = pOp->p1;-
1137 pOut->enc = encoding;-
1138 UPDATE_MAX_BLOBSIZE(pOut);-
1139#ifndef SQLITE_LIKE_DOESNT_MATCH_BLOBS-
1140 if( pOp->p3>0 ){
pOp->p3>0Description
TRUEevaluated 5987 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 688770 times by 58 tests
Evaluated by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (3)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (35)
  • Self test (38)
  • Self test (39)
  • Self test (4)
  • Self test (42)
  • Self test (43)
  • Self test (438)
  • Self test (44)
  • Self test (45)
  • Self test (46)
  • Self test (47)
  • ...
5987-688770
1141 assert( pOp->p3<=(p->nMem+1 - p->nCursor) );-
1142 pIn3 = &aMem[pOp->p3];-
1143 assert( pIn3->flags & MEM_Int );-
1144 if( pIn3->u.i==pOp->p5 ) pOut->flags = MEM_Blob|MEM_Static|MEM_Term;
executed 2628 times by 1 test: pOut->flags = 0x0010|0x0800|0x0200;
Executed by:
  • Self test (438)
pIn3->u.i==pOp->p5Description
TRUEevaluated 2628 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 3359 times by 1 test
Evaluated by:
  • Self test (438)
2628-3359
1145 }
executed 5987 times by 1 test: end of block
Executed by:
  • Self test (438)
5987
1146#endif-
1147 break;
executed 694757 times by 58 tests: break;
Executed by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (105)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (3)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (35)
  • Self test (38)
  • Self test (39)
  • Self test (4)
  • Self test (42)
  • Self test (43)
  • Self test (438)
  • Self test (44)
  • Self test (45)
  • Self test (46)
  • Self test (47)
  • ...
694757
1148}-
1149-
1150/* Opcode: Null P1 P2 P3 * *-
1151** Synopsis: r[P2..P3]=NULL-
1152**-
1153** Write a NULL into registers P2. If P3 greater than P2, then also write-
1154** NULL into register P3 and every register in between P2 and P3. If P3-
1155** is less than P2 (typically P3 is zero) then only register P2 is-
1156** set to NULL.-
1157**-
1158** If the P1 value is non-zero, then also set the MEM_Cleared flag so that-
1159** NULL values will not compare equal even if SQLITE_NULLEQ is set on-
1160** OP_Ne or OP_Eq.-
1161*/-
1162case
executed 472719 times by 382 tests: case 73:
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • ...
OP_Null: { /* out2 */
executed 472719 times by 382 tests: case 73:
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • ...
472719
1163 int cnt;-
1164 u16 nullFlag;-
1165 pOut = out2Prerelease(p, pOp);-
1166 cnt = pOp->p3-pOp->p2;-
1167 assert( pOp->p3<=(p->nMem+1 - p->nCursor) );-
1168 pOut->flags = nullFlag = pOp->p1 ? (MEM_Null|MEM_Cleared) : MEM_Null;
pOp->p1Description
TRUEevaluated 38 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 472681 times by 382 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • ...
38-472681
1169 pOut->n = 0;-
1170#ifdef SQLITE_DEBUG-
1171 pOut->uTemp = 0;-
1172#endif-
1173 while( cnt>0 ){
cnt>0Description
TRUEevaluated 106565 times by 374 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • ...
FALSEevaluated 472719 times by 382 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • ...
106565-472719
1174 pOut++;-
1175 memAboutToChange(p, pOut);-
1176 sqlite3VdbeMemSetNull(pOut);-
1177 pOut->flags = nullFlag;-
1178 pOut->n = 0;-
1179 cnt--;-
1180 }
executed 106565 times by 374 tests: end of block
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • ...
106565
1181 break;
executed 472719 times by 382 tests: break;
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • ...
472719
1182}-
1183-
1184/* Opcode: SoftNull P1 * * * *-
1185** Synopsis: r[P1]=NULL-
1186**-
1187** Set register P1 to have the value NULL as seen by the OP_MakeRecord-
1188** instruction, but do not free any string or blob memory associated with-
1189** the register, so that if the value was a string or blob that was-
1190** previously copied using OP_SCopy, the copies will continue to be valid.-
1191*/-
1192case
executed 312623 times by 1 test: case 74:
Executed by:
  • Self test (438)
OP_SoftNull: {
executed 312623 times by 1 test: case 74:
Executed by:
  • Self test (438)
312623
1193 assert( pOp->p1>0 && pOp->p1<=(p->nMem+1 - p->nCursor) );-
1194 pOut = &aMem[pOp->p1];-
1195 pOut->flags = (pOut->flags&~(MEM_Undefined|MEM_AffMask))|MEM_Null;-
1196 break;
executed 312623 times by 1 test: break;
Executed by:
  • Self test (438)
312623
1197}-
1198-
1199/* Opcode: Blob P1 P2 * P4 *-
1200** Synopsis: r[P2]=P4 (len=P1)-
1201**-
1202** P4 points to a blob of data P1 bytes long. Store this-
1203** blob in register P2.-
1204*/-
1205case
executed 78777 times by 28 tests: case 75:
Executed by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (438)
  • Self test (47)
  • Self test (48)
  • Self test (57)
  • Self test (58)
  • Self test (72)
  • Self test (73)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • ...
OP_Blob: { /* out2 */
executed 78777 times by 28 tests: case 75:
Executed by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (438)
  • Self test (47)
  • Self test (48)
  • Self test (57)
  • Self test (58)
  • Self test (72)
  • Self test (73)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • ...
78777
1206 assert( pOp->p1 <= SQLITE_MAX_LENGTH );-
1207 pOut = out2Prerelease(p, pOp);-
1208 sqlite3VdbeMemSetStr(pOut, pOp->p4.z, pOp->p1, 0, 0);-
1209 pOut->enc = encoding;-
1210 UPDATE_MAX_BLOBSIZE(pOut);-
1211 break;
executed 78777 times by 28 tests: break;
Executed by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (438)
  • Self test (47)
  • Self test (48)
  • Self test (57)
  • Self test (58)
  • Self test (72)
  • Self test (73)
  • Self test (91)
  • Self test (92)
  • Self test (93)
  • Self test (94)
  • Self test (95)
  • Self test (96)
  • ...
78777
1212}-
1213-
1214/* Opcode: Variable P1 P2 * P4 *-
1215** Synopsis: r[P2]=parameter(P1,P4)-
1216**-
1217** Transfer the values of bound parameter P1 into register P2-
1218**-
1219** If the parameter is named, then its name appears in P4.-
1220** The P4 value is used by sqlite3_bind_parameter_name().-
1221*/-
1222case
executed 4835440 times by 1 test: case 76:
Executed by:
  • Self test (438)
OP_Variable: { /* out2 */
executed 4835440 times by 1 test: case 76:
Executed by:
  • Self test (438)
4835440
1223 Mem *pVar; /* Value being transferred */-
1224-
1225 assert( pOp->p1>0 && pOp->p1<=p->nVar );-
1226 assert( pOp->p4.z==0 || pOp->p4.z==sqlite3VListNumToName(p->pVList,pOp->p1) );-
1227 pVar = &p->aVar[pOp->p1 - 1];-
1228 if( sqlite3VdbeMemTooBig(pVar) ){
sqlite3VdbeMemTooBig(pVar)Description
TRUEnever evaluated
FALSEevaluated 4835440 times by 1 test
Evaluated by:
  • Self test (438)
0-4835440
1229 goto too_big;
never executed: goto too_big;
0
1230 }-
1231 pOut = &aMem[pOp->p2];-
1232 sqlite3VdbeMemShallowCopy(pOut, pVar, MEM_Static);-
1233 UPDATE_MAX_BLOBSIZE(pOut);-
1234 break;
executed 4835440 times by 1 test: break;
Executed by:
  • Self test (438)
4835440
1235}-
1236-
1237/* Opcode: Move P1 P2 P3 * *-
1238** Synopsis: r[P2@P3]=r[P1@P3]-
1239**-
1240** Move the P3 values in register P1..P1+P3-1 over into-
1241** registers P2..P2+P3-1. Registers P1..P1+P3-1 are-
1242** left holding a NULL. It is an error for register ranges-
1243** P1..P1+P3-1 and P2..P2+P3-1 to overlap. It is an error-
1244** for P3 to be less than 1.-
1245*/-
1246case
executed 44795 times by 1 test: case 77:
Executed by:
  • Self test (438)
OP_Move: {
executed 44795 times by 1 test: case 77:
Executed by:
  • Self test (438)
44795
1247 int n; /* Number of registers left to copy */-
1248 int p1; /* Register to copy from */-
1249 int p2; /* Register to copy to */-
1250-
1251 n = pOp->p3;-
1252 p1 = pOp->p1;-
1253 p2 = pOp->p2;-
1254 assert( n>0 && p1>0 && p2>0 );-
1255 assert( p1+n<=p2 || p2+n<=p1 );-
1256-
1257 pIn1 = &aMem[p1];-
1258 pOut = &aMem[p2];-
1259 do{-
1260 assert( pOut<=&aMem[(p->nMem+1 - p->nCursor)] );-
1261 assert( pIn1<=&aMem[(p->nMem+1 - p->nCursor)] );-
1262 assert( memIsValid(pIn1) );-
1263 memAboutToChange(p, pOut);-
1264 sqlite3VdbeMemMove(pOut, pIn1);-
1265#ifdef SQLITE_DEBUG-
1266 if( pOut->pScopyFrom>=&aMem[p1] && pOut->pScopyFrom<pOut ){-
1267 pOut->pScopyFrom += pOp->p2 - p1;-
1268 }-
1269#endif-
1270 Deephemeralize(pOut);
never executed: goto no_mem;
((pOut)->flags&0x1000)!=0Description
TRUEnever evaluated
FALSEevaluated 49558 times by 1 test
Evaluated by:
  • Self test (438)
sqlite3VdbeMem...riteable(pOut)Description
TRUEnever evaluated
FALSEnever evaluated
0-49558
1271 REGISTER_TRACE(p2++, pOut);-
1272 pIn1++;-
1273 pOut++;-
1274 }while( --n );
executed 49558 times by 1 test: end of block
Executed by:
  • Self test (438)
--nDescription
TRUEevaluated 4763 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 44795 times by 1 test
Evaluated by:
  • Self test (438)
4763-49558
1275 break;
executed 44795 times by 1 test: break;
Executed by:
  • Self test (438)
44795
1276}-
1277-
1278/* Opcode: Copy P1 P2 P3 * *-
1279** Synopsis: r[P2@P3+1]=r[P1@P3+1]-
1280**-
1281** Make a copy of registers P1..P1+P3 into registers P2..P2+P3.-
1282**-
1283** This instruction makes a deep copy of the value. A duplicate-
1284** is made of any string or blob constant. See also OP_SCopy.-
1285*/-
1286case
executed 3768705 times by 32 tests: case 78:
Executed by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (42)
  • Self test (438)
  • Self test (44)
  • Self test (46)
  • Self test (47)
  • Self test (48)
  • Self test (57)
  • Self test (58)
  • Self test (72)
  • Self test (73)
  • Self test (91)
  • Self test (92)
  • ...
OP_Copy: {
executed 3768705 times by 32 tests: case 78:
Executed by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (42)
  • Self test (438)
  • Self test (44)
  • Self test (46)
  • Self test (47)
  • Self test (48)
  • Self test (57)
  • Self test (58)
  • Self test (72)
  • Self test (73)
  • Self test (91)
  • Self test (92)
  • ...
3768705
1287 int n;-
1288-
1289 n = pOp->p3;-
1290 pIn1 = &aMem[pOp->p1];-
1291 pOut = &aMem[pOp->p2];-
1292 assert( pOut!=pIn1 );-
1293 while( 1 ){-
1294 memAboutToChange(p, pOut);-
1295 sqlite3VdbeMemShallowCopy(pOut, pIn1, MEM_Ephem);-
1296 Deephemeralize(pOut);
never executed: goto no_mem;
((pOut)->flags&0x1000)!=0Description
TRUEevaluated 3827793 times by 32 tests
Evaluated by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (42)
  • Self test (438)
  • Self test (44)
  • Self test (46)
  • Self test (47)
  • Self test (48)
  • Self test (57)
  • Self test (58)
  • Self test (72)
  • Self test (73)
  • Self test (91)
  • Self test (92)
  • ...
FALSEevaluated 15403 times by 1 test
Evaluated by:
  • Self test (438)
sqlite3VdbeMem...riteable(pOut)Description
TRUEnever evaluated
FALSEevaluated 3827793 times by 32 tests
Evaluated by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (42)
  • Self test (438)
  • Self test (44)
  • Self test (46)
  • Self test (47)
  • Self test (48)
  • Self test (57)
  • Self test (58)
  • Self test (72)
  • Self test (73)
  • Self test (91)
  • Self test (92)
  • ...
0-3827793
1297#ifdef SQLITE_DEBUG-
1298 pOut->pScopyFrom = 0;-
1299#endif-
1300 REGISTER_TRACE(pOp->p2+pOp->p3-n, pOut);-
1301 if( (n--)==0 ) break;
executed 3768705 times by 32 tests: break;
Executed by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (42)
  • Self test (438)
  • Self test (44)
  • Self test (46)
  • Self test (47)
  • Self test (48)
  • Self test (57)
  • Self test (58)
  • Self test (72)
  • Self test (73)
  • Self test (91)
  • Self test (92)
  • ...
(n--)==0Description
TRUEevaluated 3768705 times by 32 tests
Evaluated by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (42)
  • Self test (438)
  • Self test (44)
  • Self test (46)
  • Self test (47)
  • Self test (48)
  • Self test (57)
  • Self test (58)
  • Self test (72)
  • Self test (73)
  • Self test (91)
  • Self test (92)
  • ...
FALSEevaluated 74491 times by 1 test
Evaluated by:
  • Self test (438)
74491-3768705
1302 pOut++;-
1303 pIn1++;-
1304 }
executed 74491 times by 1 test: end of block
Executed by:
  • Self test (438)
74491
1305 break;
executed 3768705 times by 32 tests: break;
Executed by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (42)
  • Self test (438)
  • Self test (44)
  • Self test (46)
  • Self test (47)
  • Self test (48)
  • Self test (57)
  • Self test (58)
  • Self test (72)
  • Self test (73)
  • Self test (91)
  • Self test (92)
  • ...
3768705
1306}-
1307-
1308/* Opcode: SCopy P1 P2 * * *-
1309** Synopsis: r[P2]=r[P1]-
1310**-
1311** Make a shallow copy of register P1 into register P2.-
1312**-
1313** This instruction makes a shallow copy of the value. If the value-
1314** is a string or blob, then the copy is only a pointer to the-
1315** original and hence if the original changes so will the copy.-
1316** Worse, if the original is deallocated, the copy becomes invalid.-
1317** Thus the program must guarantee that the original will not change-
1318** during the lifetime of the copy. Use OP_Copy to make a complete-
1319** copy.-
1320*/-
1321case
executed 1539627 times by 368 tests: case 79:
Executed by:
  • Self test (10)
  • Self test (100)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • ...
OP_SCopy: { /* out2 */
executed 1539627 times by 368 tests: case 79:
Executed by:
  • Self test (10)
  • Self test (100)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • ...
1539627
1322 pIn1 = &aMem[pOp->p1];-
1323 pOut = &aMem[pOp->p2];-
1324 assert( pOut!=pIn1 );-
1325 sqlite3VdbeMemShallowCopy(pOut, pIn1, MEM_Ephem);-
1326#ifdef SQLITE_DEBUG-
1327 pOut->pScopyFrom = pIn1;-
1328 pOut->mScopyFlags = pIn1->flags;-
1329#endif-
1330 break;
executed 1539627 times by 368 tests: break;
Executed by:
  • Self test (10)
  • Self test (100)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • ...
1539627
1331}-
1332-
1333/* Opcode: IntCopy P1 P2 * * *-
1334** Synopsis: r[P2]=r[P1]-
1335**-
1336** Transfer the integer value held in register P1 into register P2.-
1337**-
1338** This is an optimized version of SCopy that works only for integer-
1339** values.-
1340*/-
1341case
executed 1105171 times by 368 tests: case 80:
Executed by:
  • Self test (10)
  • Self test (100)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • ...
OP_IntCopy: { /* out2 */
executed 1105171 times by 368 tests: case 80:
Executed by:
  • Self test (10)
  • Self test (100)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • ...
1105171
1342 pIn1 = &aMem[pOp->p1];-
1343 assert( (pIn1->flags & MEM_Int)!=0 );-
1344 pOut = &aMem[pOp->p2];-
1345 sqlite3VdbeMemSetInt64(pOut, pIn1->u.i);-
1346 break;
executed 1105171 times by 368 tests: break;
Executed by:
  • Self test (10)
  • Self test (100)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • ...
1105171
1347}-
1348-
1349/* Opcode: ResultRow P1 P2 * * *-
1350** Synopsis: output=r[P1@P2]-
1351**-
1352** The registers P1 through P1+P2-1 contain a single row of-
1353** results. This opcode causes the sqlite3_step() call to terminate-
1354** with an SQLITE_ROW return code and it sets up the sqlite3_stmt-
1355** structure to provide access to the r(P1)..r(P1+P2-1) values as-
1356** the result row.-
1357*/-
1358case
executed 2694812 times by 434 tests: case 81:
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
OP_ResultRow: {
executed 2694812 times by 434 tests: case 81:
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
2694812
1359 Mem *pMem;-
1360 int i;-
1361 assert( p->nResColumn==pOp->p2 );-
1362 assert( pOp->p1>0 );-
1363 assert( pOp->p1+pOp->p2<=(p->nMem+1 - p->nCursor)+1 );-
1364-
1365#ifndef SQLITE_OMIT_PROGRESS_CALLBACK-
1366 /* Run the progress counter just before returning.-
1367 */-
1368 if( db->xProgress!=0
db->xProgress!=0Description
TRUEevaluated 21 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 2694791 times by 434 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
21-2694791
1369 && nVmStep>=nProgressLimit
nVmStep>=nProgressLimitDescription
TRUEevaluated 17 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 4 times by 1 test
Evaluated by:
  • Self test (438)
4-17
1370 && db->xProgress(db->pProgressArg)!=0
db->xProgress(...rogressArg)!=0Description
TRUEevaluated 5 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 12 times by 1 test
Evaluated by:
  • Self test (438)
5-12
1371 ){-
1372 rc = SQLITE_INTERRUPT;-
1373 goto abort_due_to_error;
executed 5 times by 1 test: goto abort_due_to_error;
Executed by:
  • Self test (438)
5
1374 }-
1375#endif-
1376-
1377 /* If this statement has violated immediate foreign key constraints, do-
1378 ** not return the number of rows modified. And do not RELEASE the statement-
1379 ** transaction. It needs to be rolled back. */-
1380 if( SQLITE_OK!=(rc = sqlite3VdbeCheckFk(p, 0)) ){
0!=(rc = sqlit...CheckFk(p, 0))Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 2694775 times by 434 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
32-2694775
1381 assert( db->flags&SQLITE_CountRows );-
1382 assert( p->usesStmtJournal );-
1383 goto abort_due_to_error;
executed 32 times by 1 test: goto abort_due_to_error;
Executed by:
  • Self test (438)
32
1384 }-
1385-
1386 /* If the SQLITE_CountRows flag is set in sqlite3.flags mask, then -
1387 ** DML statements invoke this opcode to return the number of rows -
1388 ** modified to the user. This is the only way that a VM that-
1389 ** opens a statement transaction may invoke this opcode.-
1390 **-
1391 ** In case this is such a statement, close any statement transaction-
1392 ** opened by this VM before returning control to the user. This is to-
1393 ** ensure that statement-transactions are always nested, not overlapping.-
1394 ** If the open statement-transaction is not closed here, then the user-
1395 ** may step another VM that opens its own statement transaction. This-
1396 ** may lead to overlapping statement transactions.-
1397 **-
1398 ** The statement transaction is never a top-level transaction. Hence-
1399 ** the RELEASE call below can never fail.-
1400 */-
1401 assert( p->iStatement==0 || db->flags&SQLITE_CountRows );-
1402 rc = sqlite3VdbeCloseStatement(p, SAVEPOINT_RELEASE);-
1403 assert( rc==SQLITE_OK );-
1404-
1405 /* Invalidate all ephemeral cursor row caches */-
1406 p->cacheCtr = (p->cacheCtr + 2)|1;-
1407-
1408 /* Make sure the results of the current row are \000 terminated-
1409 ** and have an assigned type. The results are de-ephemeralized as-
1410 ** a side effect.-
1411 */-
1412 pMem = p->pResultSet = &aMem[pOp->p1];-
1413 for(i=0; i<pOp->p2; i++){
i<pOp->p2Description
TRUEevaluated 6568060 times by 434 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
FALSEevaluated 2694775 times by 434 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
2694775-6568060
1414 assert( memIsValid(&pMem[i]) );-
1415 Deephemeralize(&pMem[i]);
never executed: goto no_mem;
((&pMem[i])->flags&0x1000)!=0Description
TRUEevaluated 2131 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 6565929 times by 434 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
sqlite3VdbeMem...able(&pMem[i])Description
TRUEnever evaluated
FALSEevaluated 2131 times by 1 test
Evaluated by:
  • Self test (438)
0-6565929
1416 assert( (pMem[i].flags & MEM_Ephem)==0-
1417 || (pMem[i].flags & (MEM_Str|MEM_Blob))==0 );-
1418 sqlite3VdbeMemNulTerminate(&pMem[i]);-
1419 REGISTER_TRACE(pOp->p1+i, &pMem[i]);-
1420 }
executed 6568060 times by 434 tests: end of block
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
6568060
1421 if( db->mallocFailed ) goto no_mem;
never executed: goto no_mem;
db->mallocFailedDescription
TRUEnever evaluated
FALSEevaluated 2694775 times by 434 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
0-2694775
1422-
1423 if( db->mTrace & SQLITE_TRACE_ROW ){
db->mTrace & 0x04Description
TRUEevaluated 64 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 2694711 times by 434 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
64-2694711
1424 db->xTrace(SQLITE_TRACE_ROW, db->pTraceArg, p, 0);-
1425 }
executed 64 times by 1 test: end of block
Executed by:
  • Self test (438)
64
1426-
1427 /* Return SQLITE_ROW-
1428 */-
1429 p->pc = (int)(pOp - aOp) + 1;-
1430 rc = SQLITE_ROW;-
1431 goto vdbe_return;
executed 2694775 times by 434 tests: goto vdbe_return;
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (103)
  • Self test (104)
  • Self test (105)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (11)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (12)
  • Self test (120)
  • Self test (121)
  • ...
2694775
1432}-
1433-
1434/* Opcode: Concat P1 P2 P3 * *-
1435** Synopsis: r[P3]=r[P2]+r[P1]-
1436**-
1437** Add the text in register P1 onto the end of the text in-
1438** register P2 and store the result in register P3.-
1439** If either the P1 or P2 text are NULL then store NULL in P3.-
1440**-
1441** P3 = P2 || P1-
1442**-
1443** It is illegal for P1 and P3 to be the same register. Sometimes,-
1444** if P3 is the same register as P2, the implementation is able-
1445** to avoid a memcpy().-
1446*/-
1447case
executed 346937 times by 3 tests: case 101:
Executed by:
  • Self test (101)
  • Self test (34)
  • Self test (438)
OP_Concat: { /* same as TK_CONCAT, in1, in2, out3 */
executed 346937 times by 3 tests: case 101:
Executed by:
  • Self test (101)
  • Self test (34)
  • Self test (438)
346937
1448 i64 nByte;-
1449-
1450 pIn1 = &aMem[pOp->p1];-
1451 pIn2 = &aMem[pOp->p2];-
1452 pOut = &aMem[pOp->p3];-
1453 assert( pIn1!=pOut );-
1454 if( (pIn1->flags | pIn2->flags) & MEM_Null ){
(pIn1->flags |...lags) & 0x0001Description
TRUEevaluated 154 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 346783 times by 3 tests
Evaluated by:
  • Self test (101)
  • Self test (34)
  • Self test (438)
154-346783
1455 sqlite3VdbeMemSetNull(pOut);-
1456 break;
executed 154 times by 1 test: break;
Executed by:
  • Self test (438)
154
1457 }-
1458 if( ExpandBlob(pIn1) || ExpandBlob(pIn2) ) goto no_mem;
never executed: goto no_mem;
((pIn1)->flags&0x4000)Description
TRUEnever evaluated
FALSEevaluated 346783 times by 3 tests
Evaluated by:
  • Self test (101)
  • Self test (34)
  • Self test (438)
((pIn2)->flags&0x4000)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 346782 times by 3 tests
Evaluated by:
  • Self test (101)
  • Self test (34)
  • Self test (438)
(((pIn1)->flag...dBlob(pIn1):0)Description
TRUEnever evaluated
FALSEevaluated 346783 times by 3 tests
Evaluated by:
  • Self test (101)
  • Self test (34)
  • Self test (438)
(((pIn2)->flag...dBlob(pIn2):0)Description
TRUEnever evaluated
FALSEevaluated 346783 times by 3 tests
Evaluated by:
  • Self test (101)
  • Self test (34)
  • Self test (438)
0-346783
1459 Stringify(pIn1, encoding);
never executed: goto no_mem;
((pIn1)->flags...02|0x0010))==0Description
TRUEevaluated 40300 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 306483 times by 3 tests
Evaluated by:
  • Self test (101)
  • Self test (34)
  • Self test (438)
sqlite3VdbeMem...n1,encoding,0)Description
TRUEnever evaluated
FALSEevaluated 40300 times by 1 test
Evaluated by:
  • Self test (438)
0-306483
1460 Stringify(pIn2, encoding);
never executed: goto no_mem;
((pIn2)->flags...02|0x0010))==0Description
TRUEevaluated 28628 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 318155 times by 3 tests
Evaluated by:
  • Self test (101)
  • Self test (34)
  • Self test (438)
sqlite3VdbeMem...n2,encoding,0)Description
TRUEnever evaluated
FALSEevaluated 28628 times by 1 test
Evaluated by:
  • Self test (438)
0-318155
1461 nByte = pIn1->n + pIn2->n;-
1462 if( nByte>db->aLimit[SQLITE_LIMIT_LENGTH] ){
nByte>db->aLimit[0]Description
TRUEnever evaluated
FALSEevaluated 346783 times by 3 tests
Evaluated by:
  • Self test (101)
  • Self test (34)
  • Self test (438)
0-346783
1463 goto too_big;
never executed: goto too_big;
0
1464 }-
1465 if( sqlite3VdbeMemGrow(pOut, (int)nByte+2, pOut==pIn2) ){
sqlite3VdbeMem...2, pOut==pIn2)Description
TRUEnever evaluated
FALSEevaluated 346783 times by 3 tests
Evaluated by:
  • Self test (101)
  • Self test (34)
  • Self test (438)
0-346783
1466 goto no_mem;
never executed: goto no_mem;
0
1467 }-
1468 MemSetTypeFlag(pOut, MEM_Str);-
1469 if( pOut!=pIn2 ){
pOut!=pIn2Description
TRUEevaluated 346160 times by 3 tests
Evaluated by:
  • Self test (101)
  • Self test (34)
  • Self test (438)
FALSEevaluated 623 times by 1 test
Evaluated by:
  • Self test (438)
623-346160
1470 memcpy(pOut->z, pIn2->z, pIn2->n);-
1471 }
executed 346160 times by 3 tests: end of block
Executed by:
  • Self test (101)
  • Self test (34)
  • Self test (438)
346160
1472 memcpy(&pOut->z[pIn2->n], pIn1->z, pIn1->n);-
1473 pOut->z[nByte]=0;-
1474 pOut->z[nByte+1] = 0;-
1475 pOut->flags |= MEM_Term;-
1476 pOut->n = (int)nByte;-
1477 pOut->enc = encoding;-
1478 UPDATE_MAX_BLOBSIZE(pOut);-
1479 break;
executed 346783 times by 3 tests: break;
Executed by:
  • Self test (101)
  • Self test (34)
  • Self test (438)
346783
1480}-
1481-
1482/* Opcode: Add P1 P2 P3 * *-
1483** Synopsis: r[P3]=r[P1]+r[P2]-
1484**-
1485** Add the value in register P1 to the value in register P2-
1486** and store the result in register P3.-
1487** If either input is NULL, the result is NULL.-
1488*/-
1489/* Opcode: Multiply P1 P2 P3 * *-
1490** Synopsis: r[P3]=r[P1]*r[P2]-
1491**-
1492**-
1493** Multiply the value in register P1 by the value in register P2-
1494** and store the result in register P3.-
1495** If either input is NULL, the result is NULL.-
1496*/-
1497/* Opcode: Subtract P1 P2 P3 * *-
1498** Synopsis: r[P3]=r[P2]-r[P1]-
1499**-
1500** Subtract the value in register P1 from the value in register P2-
1501** and store the result in register P3.-
1502** If either input is NULL, the result is NULL.-
1503*/-
1504/* Opcode: Divide P1 P2 P3 * *-
1505** Synopsis: r[P3]=r[P2]/r[P1]-
1506**-
1507** Divide the value in register P1 by the value in register P2-
1508** and store the result in register P3 (P3=P2/P1). If the value in -
1509** register P1 is zero, then the result is NULL. If either input is -
1510** NULL, the result is NULL.-
1511*/-
1512/* Opcode: Remainder P1 P2 P3 * *-
1513** Synopsis: r[P3]=r[P2]%r[P1]-
1514**-
1515** Compute the remainder after integer register P2 is divided by -
1516** register P1 and store the result in register P3. -
1517** If the value in register P1 is zero the result is NULL.-
1518** If either operand is NULL, the result is NULL.-
1519*/-
1520case
executed 2659336 times by 1 test: case 96:
Executed by:
  • Self test (438)
OP_Add: /* same as TK_PLUS, in1, in2, out3 */
executed 2659336 times by 1 test: case 96:
Executed by:
  • Self test (438)
2659336
1521case
executed 1381546 times by 1 test: case 97:
Executed by:
  • Self test (438)
OP_Subtract: /* same as TK_MINUS, in1, in2, out3 */
executed 1381546 times by 1 test: case 97:
Executed by:
  • Self test (438)
1381546
1522case
executed 1418517 times by 1 test: case 98:
Executed by:
  • Self test (438)
OP_Multiply: /* same as TK_STAR, in1, in2, out3 */
executed 1418517 times by 1 test: case 98:
Executed by:
  • Self test (438)
1418517
1523case
executed 873762 times by 1 test: case 99:
Executed by:
  • Self test (438)
OP_Divide: /* same as TK_SLASH, in1, in2, out3 */
executed 873762 times by 1 test: case 99:
Executed by:
  • Self test (438)
873762
1524case
executed 1542476 times by 335 tests: case 100:
Executed by:
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • Self test (127)
  • Self test (128)
  • Self test (129)
  • Self test (130)
  • ...
OP_Remainder: { /* same as TK_REM, in1, in2, out3 */
executed 1542476 times by 335 tests: case 100:
Executed by:
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • Self test (127)
  • Self test (128)
  • Self test (129)
  • Self test (130)
  • ...
1542476
1525 char bIntint; /* Started out as two integer operands */-
1526 u16 flags; /* Combined MEM_* flags from both inputs */-
1527 u16 type1; /* Numeric type of left operand */-
1528 u16 type2; /* Numeric type of right operand */-
1529 i64 iA; /* Integer value of left operand */-
1530 i64 iB; /* Integer value of right operand */-
1531 double rA; /* Real value of left operand */-
1532 double rB; /* Real value of right operand */-
1533-
1534 pIn1 = &aMem[pOp->p1];-
1535 type1 = numericType(pIn1);-
1536 pIn2 = &aMem[pOp->p2];-
1537 type2 = numericType(pIn2);-
1538 pOut = &aMem[pOp->p3];-
1539 flags = pIn1->flags | pIn2->flags;-
1540 if( (type1 & type2 & MEM_Int)!=0 ){
(type1 & type2 & 0x0004)!=0Description
TRUEevaluated 7720532 times by 335 tests
Evaluated by:
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • Self test (127)
  • Self test (128)
  • Self test (129)
  • Self test (130)
  • ...
FALSEevaluated 155105 times by 1 test
Evaluated by:
  • Self test (438)
155105-7720532
1541 iA = pIn1->u.i;-
1542 iB = pIn2->u.i;-
1543 bIntint = 1;-
1544 switch( pOp->opcode ){-
1545 case OP_Add: if( sqlite3AddInt64(&iB,iA) ) goto fp_math; break;
executed 17 times by 1 test: goto fp_math;
Executed by:
  • Self test (438)
executed 2608572 times by 1 test: break;
Executed by:
  • Self test (438)
sqlite3AddInt64(&iB,iA)Description
TRUEevaluated 17 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 2608572 times by 1 test
Evaluated by:
  • Self test (438)
executed 2608589 times by 1 test: case 96:
Executed by:
  • Self test (438)
17-2608589
1546 case OP_Subtract: if( sqlite3SubInt64(&iB,iA) ) goto fp_math; break;
executed 15 times by 1 test: goto fp_math;
Executed by:
  • Self test (438)
executed 1367017 times by 1 test: break;
Executed by:
  • Self test (438)
sqlite3SubInt64(&iB,iA)Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1367017 times by 1 test
Evaluated by:
  • Self test (438)
executed 1367032 times by 1 test: case 97:
Executed by:
  • Self test (438)
15-1367032
1547 case OP_Multiply: if( sqlite3MulInt64(&iB,iA) ) goto fp_math; break;
executed 2206 times by 1 test: goto fp_math;
Executed by:
  • Self test (438)
executed 1326958 times by 1 test: break;
Executed by:
  • Self test (438)
sqlite3MulInt64(&iB,iA)Description
TRUEevaluated 2206 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1326958 times by 1 test
Evaluated by:
  • Self test (438)
executed 1329164 times by 1 test: case 98:
Executed by:
  • Self test (438)
2206-1329164
1548 case OP_Divide: {
executed 873532 times by 1 test: case 99:
Executed by:
  • Self test (438)
873532
1549 if( iA==0 ) goto arithmetic_result_is_null;
executed 764 times by 1 test: goto arithmetic_result_is_null;
Executed by:
  • Self test (438)
iA==0Description
TRUEevaluated 764 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 872768 times by 1 test
Evaluated by:
  • Self test (438)
764-872768
1550 if( iA==-1 && iB==SMALLEST_INT64 ) goto fp_math;
executed 1 time by 1 test: goto fp_math;
Executed by:
  • Self test (438)
iA==-1Description
TRUEevaluated 87 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 872681 times by 1 test
Evaluated by:
  • Self test (438)
iB==(((i64)-1)...ffffff)<<32)))Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 86 times by 1 test
Evaluated by:
  • Self test (438)
1-872681
1551 iB /= iA;-
1552 break;
executed 872767 times by 1 test: break;
Executed by:
  • Self test (438)
872767
1553 }-
1554 default: {
executed 1542215 times by 335 tests: default:
Executed by:
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • Self test (127)
  • Self test (128)
  • Self test (129)
  • Self test (130)
  • ...
1542215
1555 if( iA==0 ) goto arithmetic_result_is_null;
executed 762 times by 1 test: goto arithmetic_result_is_null;
Executed by:
  • Self test (438)
iA==0Description
TRUEevaluated 762 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1541453 times by 335 tests
Evaluated by:
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • Self test (127)
  • Self test (128)
  • Self test (129)
  • Self test (130)
  • ...
762-1541453
1556 if( iA==-1 ) iA = 1;
executed 84 times by 1 test: iA = 1;
Executed by:
  • Self test (438)
iA==-1Description
TRUEevaluated 84 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1541369 times by 335 tests
Evaluated by:
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • Self test (127)
  • Self test (128)
  • Self test (129)
  • Self test (130)
  • ...
84-1541369
1557 iB %= iA;-
1558 break;
executed 1541453 times by 335 tests: break;
Executed by:
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • Self test (127)
  • Self test (128)
  • Self test (129)
  • Self test (130)
  • ...
1541453
1559 }-
1560 }-
1561 pOut->u.i = iB;-
1562 MemSetTypeFlag(pOut, MEM_Int);-
1563 }else if( (flags & MEM_Null)!=0 ){
executed 7716767 times by 335 tests: end of block
Executed by:
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • Self test (127)
  • Self test (128)
  • Self test (129)
  • Self test (130)
  • ...
(flags & 0x0001)!=0Description
TRUEevaluated 496 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 154609 times by 1 test
Evaluated by:
  • Self test (438)
496-7716767
1564 goto arithmetic_result_is_null;
executed 496 times by 1 test: goto arithmetic_result_is_null;
Executed by:
  • Self test (438)
496
1565 }else{-
1566 bIntint = 0;-
1567fp_math:
code before this statement executed 154609 times by 1 test: fp_math:
Executed by:
  • Self test (438)
154609
1568 rA = sqlite3VdbeRealValue(pIn1);-
1569 rB = sqlite3VdbeRealValue(pIn2);-
1570 switch( pOp->opcode ){-
1571 case OP_Add: rB += rA; break;
executed 50542 times by 1 test: break;
Executed by:
  • Self test (438)
executed 50542 times by 1 test: case 96:
Executed by:
  • Self test (438)
50542
1572 case OP_Subtract: rB -= rA; break;
executed 14442 times by 1 test: break;
Executed by:
  • Self test (438)
executed 14442 times by 1 test: case 97:
Executed by:
  • Self test (438)
14442
1573 case OP_Multiply: rB *= rA; break;
executed 91483 times by 1 test: break;
Executed by:
  • Self test (438)
executed 91483 times by 1 test: case 98:
Executed by:
  • Self test (438)
91483
1574 case OP_Divide: {
executed 173 times by 1 test: case 99:
Executed by:
  • Self test (438)
173
1575 /* (double)0 In case of SQLITE_OMIT_FLOATING_POINT... */-
1576 if( rA==(double)0 ) goto arithmetic_result_is_null;
executed 94 times by 1 test: goto arithmetic_result_is_null;
Executed by:
  • Self test (438)
rA==(double)0Description
TRUEevaluated 94 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 79 times by 1 test
Evaluated by:
  • Self test (438)
79-94
1577 rB /= rA;-
1578 break;
executed 79 times by 1 test: break;
Executed by:
  • Self test (438)
79
1579 }-
1580 default: {
executed 208 times by 1 test: default:
Executed by:
  • Self test (438)
208
1581 iA = (i64)rA;-
1582 iB = (i64)rB;-
1583 if( iA==0 ) goto arithmetic_result_is_null;
executed 94 times by 1 test: goto arithmetic_result_is_null;
Executed by:
  • Self test (438)
iA==0Description
TRUEevaluated 94 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 114 times by 1 test
Evaluated by:
  • Self test (438)
94-114
1584 if( iA==-1 ) iA = 1;
executed 2 times by 1 test: iA = 1;
Executed by:
  • Self test (438)
iA==-1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 112 times by 1 test
Evaluated by:
  • Self test (438)
2-112
1585 rB = (double)(iB % iA);-
1586 break;
executed 114 times by 1 test: break;
Executed by:
  • Self test (438)
114
1587 }-
1588 }-
1589#ifdef SQLITE_OMIT_FLOATING_POINT-
1590 pOut->u.i = rB;-
1591 MemSetTypeFlag(pOut, MEM_Int);-
1592#else-
1593 if( sqlite3IsNaN(rB) ){
sqlite3IsNaN(rB)Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 156654 times by 1 test
Evaluated by:
  • Self test (438)
6-156654
1594 goto arithmetic_result_is_null;
executed 6 times by 1 test: goto arithmetic_result_is_null;
Executed by:
  • Self test (438)
6
1595 }-
1596 pOut->u.r = rB;-
1597 MemSetTypeFlag(pOut, MEM_Real);-
1598 if( ((type1|type2)&MEM_Real)==0 && !bIntint ){
((type1|type2)&0x0008)==0Description
TRUEevaluated 2584 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 154070 times by 1 test
Evaluated by:
  • Self test (438)
!bIntintDescription
TRUEevaluated 345 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 2239 times by 1 test
Evaluated by:
  • Self test (438)
345-154070
1599 sqlite3VdbeIntegerAffinity(pOut);-
1600 }
executed 345 times by 1 test: end of block
Executed by:
  • Self test (438)
345
1601#endif-
1602 }
executed 156654 times by 1 test: end of block
Executed by:
  • Self test (438)
156654
1603 break;
executed 7873421 times by 335 tests: break;
Executed by:
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • Self test (127)
  • Self test (128)
  • Self test (129)
  • Self test (130)
  • ...
7873421
1604-
1605arithmetic_result_is_null:-
1606 sqlite3VdbeMemSetNull(pOut);-
1607 break;
executed 2216 times by 1 test: break;
Executed by:
  • Self test (438)
2216
1608}-
1609-
1610/* Opcode: CollSeq P1 * * P4-
1611**-
1612** P4 is a pointer to a CollSeq object. If the next call to a user function-
1613** or aggregate calls sqlite3GetFuncCollSeq(), this collation sequence will-
1614** be returned. This is used by the built-in min(), max() and nullif()-
1615** functions.-
1616**-
1617** If P1 is not zero, then it is a register that a subsequent min() or-
1618** max() aggregate will set to 1 if the current row is not the minimum or-
1619** maximum. The P1 register is initialized to 0 by this instruction.-
1620**-
1621** The interface used by the implementation of the aforementioned functions-
1622** to retrieve the collation sequence set by this opcode is not available-
1623** publicly. Only built-in functions have access to this feature.-
1624*/-
1625case
executed 482633 times by 1 test: case 82:
Executed by:
  • Self test (438)
OP_CollSeq: {
executed 482633 times by 1 test: case 82:
Executed by:
  • Self test (438)
482633
1626 assert( pOp->p4type==P4_COLLSEQ );-
1627 if( pOp->p1 ){
pOp->p1Description
TRUEevaluated 102860 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 379773 times by 1 test
Evaluated by:
  • Self test (438)
102860-379773
1628 sqlite3VdbeMemSetInt64(&aMem[pOp->p1], 0);-
1629 }
executed 102860 times by 1 test: end of block
Executed by:
  • Self test (438)
102860
1630 break;
executed 482633 times by 1 test: break;
Executed by:
  • Self test (438)
482633
1631}-
1632-
1633/* Opcode: BitAnd P1 P2 P3 * *-
1634** Synopsis: r[P3]=r[P1]&r[P2]-
1635**-
1636** Take the bit-wise AND of the values in register P1 and P2 and-
1637** store the result in register P3.-
1638** If either input is NULL, the result is NULL.-
1639*/-
1640/* Opcode: BitOr P1 P2 P3 * *-
1641** Synopsis: r[P3]=r[P1]|r[P2]-
1642**-
1643** Take the bit-wise OR of the values in register P1 and P2 and-
1644** store the result in register P3.-
1645** If either input is NULL, the result is NULL.-
1646*/-
1647/* Opcode: ShiftLeft P1 P2 P3 * *-
1648** Synopsis: r[P3]=r[P2]<<r[P1]-
1649**-
1650** Shift the integer value in register P2 to the left by the-
1651** number of bits specified by the integer in register P1.-
1652** Store the result in register P3.-
1653** If either input is NULL, the result is NULL.-
1654*/-
1655/* Opcode: ShiftRight P1 P2 P3 * *-
1656** Synopsis: r[P3]=r[P2]>>r[P1]-
1657**-
1658** Shift the integer value in register P2 to the right by the-
1659** number of bits specified by the integer in register P1.-
1660** Store the result in register P3.-
1661** If either input is NULL, the result is NULL.-
1662*/-
1663case
executed 7926 times by 1 test: case 92:
Executed by:
  • Self test (438)
OP_BitAnd: /* same as TK_BITAND, in1, in2, out3 */
executed 7926 times by 1 test: case 92:
Executed by:
  • Self test (438)
7926
1664case
executed 4849 times by 1 test: case 93:
Executed by:
  • Self test (438)
OP_BitOr: /* same as TK_BITOR, in1, in2, out3 */
executed 4849 times by 1 test: case 93:
Executed by:
  • Self test (438)
4849
1665case
executed 2828 times by 1 test: case 94:
Executed by:
  • Self test (438)
OP_ShiftLeft: /* same as TK_LSHIFT, in1, in2, out3 */
executed 2828 times by 1 test: case 94:
Executed by:
  • Self test (438)
2828
1666case
executed 2811 times by 1 test: case 95:
Executed by:
  • Self test (438)
OP_ShiftRight: { /* same as TK_RSHIFT, in1, in2, out3 */
executed 2811 times by 1 test: case 95:
Executed by:
  • Self test (438)
2811
1667 i64 iA;-
1668 u64 uA;-
1669 i64 iB;-
1670 u8 op;-
1671-
1672 pIn1 = &aMem[pOp->p1];-
1673 pIn2 = &aMem[pOp->p2];-
1674 pOut = &aMem[pOp->p3];-
1675 if( (pIn1->flags | pIn2->flags) & MEM_Null ){
(pIn1->flags |...lags) & 0x0001Description
TRUEevaluated 326 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 18088 times by 1 test
Evaluated by:
  • Self test (438)
326-18088
1676 sqlite3VdbeMemSetNull(pOut);-
1677 break;
executed 326 times by 1 test: break;
Executed by:
  • Self test (438)
326
1678 }-
1679 iA = sqlite3VdbeIntValue(pIn2);-
1680 iB = sqlite3VdbeIntValue(pIn1);-
1681 op = pOp->opcode;-
1682 if( op==OP_BitAnd ){
op==92Description
TRUEevaluated 7786 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 10302 times by 1 test
Evaluated by:
  • Self test (438)
7786-10302
1683 iA &= iB;-
1684 }else if( op==OP_BitOr ){
executed 7786 times by 1 test: end of block
Executed by:
  • Self test (438)
op==93Description
TRUEevaluated 4787 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 5515 times by 1 test
Evaluated by:
  • Self test (438)
4787-7786
1685 iA |= iB;-
1686 }else if( iB!=0 ){
executed 4787 times by 1 test: end of block
Executed by:
  • Self test (438)
iB!=0Description
TRUEevaluated 3793 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1722 times by 1 test
Evaluated by:
  • Self test (438)
1722-4787
1687 assert( op==OP_ShiftRight || op==OP_ShiftLeft );-
1688-
1689 /* If shifting by a negative amount, shift in the other direction */-
1690 if( iB<0 ){
iB<0Description
TRUEevaluated 233 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 3560 times by 1 test
Evaluated by:
  • Self test (438)
233-3560
1691 assert( OP_ShiftRight==OP_ShiftLeft+1 );-
1692 op = 2*OP_ShiftLeft + 1 - op;-
1693 iB = iB>(-64) ? -iB : 64;
iB>(-64)Description
TRUEevaluated 184 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 49 times by 1 test
Evaluated by:
  • Self test (438)
49-184
1694 }
executed 233 times by 1 test: end of block
Executed by:
  • Self test (438)
233
1695-
1696 if( iB>=64 ){
iB>=64Description
TRUEevaluated 273 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 3520 times by 1 test
Evaluated by:
  • Self test (438)
273-3520
1697 iA = (iA>=0 || op==OP_ShiftLeft) ? 0 : -1;
iA>=0Description
TRUEevaluated 252 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 21 times by 1 test
Evaluated by:
  • Self test (438)
op==94Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 11 times by 1 test
Evaluated by:
  • Self test (438)
10-252
1698 }else{
executed 273 times by 1 test: end of block
Executed by:
  • Self test (438)
273
1699 memcpy(&uA, &iA, sizeof(uA));-
1700 if( op==OP_ShiftLeft ){
op==94Description
TRUEevaluated 1770 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1750 times by 1 test
Evaluated by:
  • Self test (438)
1750-1770
1701 uA <<= iB;-
1702 }else{
executed 1770 times by 1 test: end of block
Executed by:
  • Self test (438)
1770
1703 uA >>= iB;-
1704 /* Sign-extend on a right shift of a negative number */-
1705 if( iA<0 ) uA |= ((((u64)0xffffffff)<<32)|0xffffffff) << (64-iB);
executed 38 times by 1 test: uA |= ((((u64)0xffffffff)<<32)|0xffffffff) << (64-iB);
Executed by:
  • Self test (438)
iA<0Description
TRUEevaluated 38 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1712 times by 1 test
Evaluated by:
  • Self test (438)
38-1712
1706 }
executed 1750 times by 1 test: end of block
Executed by:
  • Self test (438)
1750
1707 memcpy(&iA, &uA, sizeof(iA));-
1708 }
executed 3520 times by 1 test: end of block
Executed by:
  • Self test (438)
3520
1709 }-
1710 pOut->u.i = iA;-
1711 MemSetTypeFlag(pOut, MEM_Int);-
1712 break;
executed 18088 times by 1 test: break;
Executed by:
  • Self test (438)
18088
1713}-
1714-
1715/* Opcode: AddImm P1 P2 * * *-
1716** Synopsis: r[P1]=r[P1]+P2-
1717** -
1718** Add the constant P2 to the value in register P1.-
1719** The result is always an integer.-
1720**-
1721** To force any register to be an integer, just add 0.-
1722*/-
1723case
executed 2718460 times by 12 tests: case 83:
Executed by:
  • Self test (43)
  • Self test (438)
  • Self test (45)
  • Self test (53)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (74)
OP_AddImm: { /* in1 */
executed 2718460 times by 12 tests: case 83:
Executed by:
  • Self test (43)
  • Self test (438)
  • Self test (45)
  • Self test (53)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (74)
2718460
1724 pIn1 = &aMem[pOp->p1];-
1725 memAboutToChange(p, pIn1);-
1726 sqlite3VdbeMemIntegerify(pIn1);-
1727 pIn1->u.i += pOp->p2;-
1728 break;
executed 2718460 times by 12 tests: break;
Executed by:
  • Self test (43)
  • Self test (438)
  • Self test (45)
  • Self test (53)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • Self test (70)
  • Self test (71)
  • Self test (74)
2718460
1729}-
1730-
1731/* Opcode: MustBeInt P1 P2 * * *-
1732** -
1733** Force the value in register P1 to be an integer. If the value-
1734** in P1 is not an integer and cannot be converted into an integer-
1735** without data loss, then jump immediately to P2, or if P2==0-
1736** raise an SQLITE_MISMATCH exception.-
1737*/-
1738case
executed 340000 times by 1 test: case 15:
Executed by:
  • Self test (438)
OP_MustBeInt: { /* jump, in1 */
executed 340000 times by 1 test: case 15:
Executed by:
  • Self test (438)
340000
1739 pIn1 = &aMem[pOp->p1];-
1740 if( (pIn1->flags & MEM_Int)==0 ){
(pIn1->flags & 0x0004)==0Description
TRUEevaluated 98 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 339902 times by 1 test
Evaluated by:
  • Self test (438)
98-339902
1741 applyAffinity(pIn1, SQLITE_AFF_NUMERIC, encoding);-
1742 VdbeBranchTaken((pIn1->flags&MEM_Int)==0, 2);-
1743 if( (pIn1->flags & MEM_Int)==0 ){
(pIn1->flags & 0x0004)==0Description
TRUEevaluated 48 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 50 times by 1 test
Evaluated by:
  • Self test (438)
48-50
1744 if( pOp->p2==0 ){
pOp->p2==0Description
TRUEevaluated 33 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 15 times by 1 test
Evaluated by:
  • Self test (438)
15-33
1745 rc = SQLITE_MISMATCH;-
1746 goto abort_due_to_error;
executed 33 times by 1 test: goto abort_due_to_error;
Executed by:
  • Self test (438)
33
1747 }else{-
1748 goto jump_to_p2;
executed 15 times by 1 test: goto jump_to_p2;
Executed by:
  • Self test (438)
15
1749 }-
1750 }-
1751 }
executed 50 times by 1 test: end of block
Executed by:
  • Self test (438)
50
1752 MemSetTypeFlag(pIn1, MEM_Int);-
1753 break;
executed 339952 times by 1 test: break;
Executed by:
  • Self test (438)
339952
1754}-
1755-
1756#ifndef SQLITE_OMIT_FLOATING_POINT-
1757/* Opcode: RealAffinity P1 * * * *-
1758**-
1759** If register P1 holds an integer convert it to a real value.-
1760**-
1761** This opcode is used when extracting information from a column that-
1762** has REAL affinity. Such column values may still be stored as-
1763** integers, for space efficiency, but after extraction we want them-
1764** to have only a real value.-
1765*/-
1766case
executed 1214168 times by 1 test: case 84:
Executed by:
  • Self test (438)
OP_RealAffinity: { /* in1 */
executed 1214168 times by 1 test: case 84:
Executed by:
  • Self test (438)
1214168
1767 pIn1 = &aMem[pOp->p1];-
1768 if( pIn1->flags & MEM_Int ){
pIn1->flags & 0x0004Description
TRUEevaluated 240045 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 974123 times by 1 test
Evaluated by:
  • Self test (438)
240045-974123
1769 sqlite3VdbeMemRealify(pIn1);-
1770 }
executed 240045 times by 1 test: end of block
Executed by:
  • Self test (438)
240045
1771 break;
executed 1214168 times by 1 test: break;
Executed by:
  • Self test (438)
1214168
1772}-
1773#endif-
1774-
1775#ifndef SQLITE_OMIT_CAST-
1776/* Opcode: Cast P1 P2 * * *-
1777** Synopsis: affinity(r[P1])-
1778**-
1779** Force the value in register P1 to be the type defined by P2.-
1780** -
1781** <ul>-
1782** <li> P2=='A' &rarr; BLOB-
1783** <li> P2=='B' &rarr; TEXT-
1784** <li> P2=='C' &rarr; NUMERIC-
1785** <li> P2=='D' &rarr; INTEGER-
1786** <li> P2=='E' &rarr; REAL-
1787** </ul>-
1788**-
1789** A NULL value is not changed by this routine. It remains NULL.-
1790*/-
1791case
executed 196168 times by 1 test: case 85:
Executed by:
  • Self test (438)
OP_Cast: { /* in1 */
executed 196168 times by 1 test: case 85:
Executed by:
  • Self test (438)
196168
1792 assert( pOp->p2>=SQLITE_AFF_BLOB && pOp->p2<=SQLITE_AFF_REAL );-
1793 testcase( pOp->p2==SQLITE_AFF_TEXT );-
1794 testcase( pOp->p2==SQLITE_AFF_BLOB );-
1795 testcase( pOp->p2==SQLITE_AFF_NUMERIC );-
1796 testcase( pOp->p2==SQLITE_AFF_INTEGER );-
1797 testcase( pOp->p2==SQLITE_AFF_REAL );-
1798 pIn1 = &aMem[pOp->p1];-
1799 memAboutToChange(p, pIn1);-
1800 rc = ExpandBlob(pIn1);
((pIn1)->flags&0x4000)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 196164 times by 1 test
Evaluated by:
  • Self test (438)
4-196164
1801 sqlite3VdbeMemCast(pIn1, pOp->p2, encoding);-
1802 UPDATE_MAX_BLOBSIZE(pIn1);-
1803 if( rc ) goto abort_due_to_error;
never executed: goto abort_due_to_error;
rcDescription
TRUEnever evaluated
FALSEevaluated 196168 times by 1 test
Evaluated by:
  • Self test (438)
0-196168
1804 break;
executed 196168 times by 1 test: break;
Executed by:
  • Self test (438)
196168
1805}-
1806#endif /* SQLITE_OMIT_CAST */-
1807-
1808/* Opcode: Eq P1 P2 P3 P4 P5-
1809** Synopsis: IF r[P3]==r[P1]-
1810**-
1811** Compare the values in register P1 and P3. If reg(P3)==reg(P1) then-
1812** jump to address P2. Or if the SQLITE_STOREP2 flag is set in P5, then-
1813** store the result of comparison in register P2.-
1814**-
1815** The SQLITE_AFF_MASK portion of P5 must be an affinity character --
1816** SQLITE_AFF_TEXT, SQLITE_AFF_INTEGER, and so forth. An attempt is made -
1817** to coerce both inputs according to this affinity before the-
1818** comparison is made. If the SQLITE_AFF_MASK is 0x00, then numeric-
1819** affinity is used. Note that the affinity conversions are stored-
1820** back into the input registers P1 and P3. So this opcode can cause-
1821** persistent changes to registers P1 and P3.-
1822**-
1823** Once any conversions have taken place, and neither value is NULL, -
1824** the values are compared. If both values are blobs then memcmp() is-
1825** used to determine the results of the comparison. If both values-
1826** are text, then the appropriate collating function specified in-
1827** P4 is used to do the comparison. If P4 is not specified then-
1828** memcmp() is used to compare text string. If both values are-
1829** numeric, then a numeric comparison is used. If the two values-
1830** are of different types, then numbers are considered less than-
1831** strings and strings are considered less than blobs.-
1832**-
1833** If SQLITE_NULLEQ is set in P5 then the result of comparison is always either-
1834** true or false and is never NULL. If both operands are NULL then the result-
1835** of comparison is true. If either operand is NULL then the result is false.-
1836** If neither operand is NULL the result is the same as it would be if-
1837** the SQLITE_NULLEQ flag were omitted from P5.-
1838**-
1839** If both SQLITE_STOREP2 and SQLITE_KEEPNULL flags are set then the-
1840** content of r[P2] is only changed if the new value is NULL or 0 (false).-
1841** In other words, a prior r[P2] value will not be overwritten by 1 (true).-
1842*/-
1843/* Opcode: Ne P1 P2 P3 P4 P5-
1844** Synopsis: IF r[P3]!=r[P1]-
1845**-
1846** This works just like the Eq opcode except that the jump is taken if-
1847** the operands in registers P1 and P3 are not equal. See the Eq opcode for-
1848** additional information.-
1849**-
1850** If both SQLITE_STOREP2 and SQLITE_KEEPNULL flags are set then the-
1851** content of r[P2] is only changed if the new value is NULL or 1 (true).-
1852** In other words, a prior r[P2] value will not be overwritten by 0 (false).-
1853*/-
1854/* Opcode: Lt P1 P2 P3 P4 P5-
1855** Synopsis: IF r[P3]<r[P1]-
1856**-
1857** Compare the values in register P1 and P3. If reg(P3)<reg(P1) then-
1858** jump to address P2. Or if the SQLITE_STOREP2 flag is set in P5 store-
1859** the result of comparison (0 or 1 or NULL) into register P2.-
1860**-
1861** If the SQLITE_JUMPIFNULL bit of P5 is set and either reg(P1) or-
1862** reg(P3) is NULL then the take the jump. If the SQLITE_JUMPIFNULL -
1863** bit is clear then fall through if either operand is NULL.-
1864**-
1865** The SQLITE_AFF_MASK portion of P5 must be an affinity character --
1866** SQLITE_AFF_TEXT, SQLITE_AFF_INTEGER, and so forth. An attempt is made -
1867** to coerce both inputs according to this affinity before the-
1868** comparison is made. If the SQLITE_AFF_MASK is 0x00, then numeric-
1869** affinity is used. Note that the affinity conversions are stored-
1870** back into the input registers P1 and P3. So this opcode can cause-
1871** persistent changes to registers P1 and P3.-
1872**-
1873** Once any conversions have taken place, and neither value is NULL, -
1874** the values are compared. If both values are blobs then memcmp() is-
1875** used to determine the results of the comparison. If both values-
1876** are text, then the appropriate collating function specified in-
1877** P4 is used to do the comparison. If P4 is not specified then-
1878** memcmp() is used to compare text string. If both values are-
1879** numeric, then a numeric comparison is used. If the two values-
1880** are of different types, then numbers are considered less than-
1881** strings and strings are considered less than blobs.-
1882*/-
1883/* Opcode: Le P1 P2 P3 P4 P5-
1884** Synopsis: IF r[P3]<=r[P1]-
1885**-
1886** This works just like the Lt opcode except that the jump is taken if-
1887** the content of register P3 is less than or equal to the content of-
1888** register P1. See the Lt opcode for additional information.-
1889*/-
1890/* Opcode: Gt P1 P2 P3 P4 P5-
1891** Synopsis: IF r[P3]>r[P1]-
1892**-
1893** This works just like the Lt opcode except that the jump is taken if-
1894** the content of register P3 is greater than the content of-
1895** register P1. See the Lt opcode for additional information.-
1896*/-
1897/* Opcode: Ge P1 P2 P3 P4 P5-
1898** Synopsis: IF r[P3]>=r[P1]-
1899**-
1900** This works just like the Lt opcode except that the jump is taken if-
1901** the content of register P3 is greater than or equal to the content of-
1902** register P1. See the Lt opcode for additional information.-
1903*/-
1904case
executed 952351 times by 39 tests: case 53:
Executed by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (43)
  • Self test (438)
  • Self test (45)
  • Self test (47)
  • Self test (48)
  • Self test (53)
  • Self test (57)
  • Self test (58)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • ...
OP_Eq: /* same as TK_EQ, jump, in1, in3 */
executed 952351 times by 39 tests: case 53:
Executed by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (24)
  • Self test (26)
  • Self test (27)
  • Self test (28)
  • Self test (29)
  • Self test (32)
  • Self test (33)
  • Self test (34)
  • Self test (43)
  • Self test (438)
  • Self test (45)
  • Self test (47)
  • Self test (48)
  • Self test (53)
  • Self test (57)
  • Self test (58)
  • Self test (65)
  • Self test (66)
  • Self test (67)
  • Self test (68)
  • Self test (69)
  • ...
952351
1905case
executed 6113772 times by 365 tests: case 52:
Executed by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • ...
OP_Ne: /* same as TK_NE, jump, in1, in3 */
executed 6113772 times by 365 tests: case 52:
Executed by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • ...
6113772
1906case
executed 505314 times by 1 test: case 56:
Executed by:
  • Self test (438)
OP_Lt: /* same as TK_LT, jump, in1, in3 */
executed 505314 times by 1 test: case 56:
Executed by:
  • Self test (438)
505314
1907case
executed 288505 times by 3 tests: case 55:
Executed by:
  • Self test (34)
  • Self test (40)
  • Self test (438)
OP_Le: /* same as TK_LE, jump, in1, in3 */
executed 288505 times by 3 tests: case 55:
Executed by:
  • Self test (34)
  • Self test (40)
  • Self test (438)
288505
1908case
executed 486663 times by 1 test: case 54:
Executed by:
  • Self test (438)
OP_Gt: /* same as TK_GT, jump, in1, in3 */
executed 486663 times by 1 test: case 54:
Executed by:
  • Self test (438)
486663
1909case
executed 972137 times by 1 test: case 57:
Executed by:
  • Self test (438)
OP_Ge: { /* same as TK_GE, jump, in1, in3 */
executed 972137 times by 1 test: case 57:
Executed by:
  • Self test (438)
972137
1910 int res, res2; /* Result of the comparison of pIn1 against pIn3 */-
1911 char affinity; /* Affinity to use for comparison */-
1912 u16 flags1; /* Copy of initial value of pIn1->flags */-
1913 u16 flags3; /* Copy of initial value of pIn3->flags */-
1914-
1915 pIn1 = &aMem[pOp->p1];-
1916 pIn3 = &aMem[pOp->p3];-
1917 flags1 = pIn1->flags;-
1918 flags3 = pIn3->flags;-
1919 if( (flags1 | flags3)&MEM_Null ){
(flags1 | flags3)&0x0001Description
TRUEevaluated 86983 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 9231759 times by 377 tests
Evaluated by:
  • Self test
  • Self test (100)
  • Self test (101)
  • Self test (104)
  • Self test (106)
  • Self test (107)
  • Self test (108)
  • Self test (109)
  • Self test (110)
  • Self test (111)
  • Self test (112)
  • Self test (113)
  • Self test (114)
  • Self test (115)
  • Self test (116)
  • Self test (117)
  • Self test (118)
  • Self test (119)
  • Self test (120)
  • Self test (121)
  • Self test (122)
  • Self test (123)
  • Self test (124)
  • Self test (125)
  • Self test (126)
  • ...
86983-9231759
1920 /* One or both operands are NULL */-
1921 if( pOp->p5 & SQLITE_NULLEQ ){
pOp->p5 & 0x80Description
TRUEevaluated 2753 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 84230 times by 1 test
Evaluated by:
  • Self test (438)
2753-84230
1922 /* If SQLITE_NULLEQ is set (which will only happen if the operator is-
1923 ** OP_Eq or OP_Ne) then take the jump or not depending on whether-
1924 ** or not both operands are null.-
1925 */-
1926 assert( pOp->opcode==OP_Eq || pOp->opcode==OP_Ne );-
1927 assert( (flags1 & MEM_Cleared)==0 );-
1928 assert( (pOp->p5 & SQLITE_JUMPIFNULL)==0 );-
1929 if( (flags1&flags3&MEM_Null)!=0
(flags1&flags3&0x0001)!=0Description
TRUEevaluated 2153 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 600 times by 1 test
Evaluated by:
  • Self test (438)
600-2153
1930 && (flags3&MEM_Cleared)==0
(flags3&0x0100)==0Description
TRUEevaluated 2152 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
1-2152
1931 ){-
1932 res = 0; /* Operands are equal */-
1933 }else{
executed 2152 times by 1 test: end of block
Executed by:
  • Self test (438)
2152
1934 res = 1; /* Operands are not equal */-
1935 }
executed 601 times by 1 test: end of block
Executed by:
  • Self test (438)
601
1936 }else{-
1937 /* SQLITE_NULLEQ is clear and at least one operand is NULL,-
1938 ** then the result is always NULL.-
1939 ** The jump is taken if the SQLITE_JUMPIFNULL bit is set.-
1940 */-
1941 if( pOp->p5 & SQLITE_STOREP2 ){
pOp->p5 & 0x20Description
TRUEevaluated 1810 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 82420 times by 1 test
Evaluated by:
  • Self test (438)
1810-82420
1942 pOut = &aMem[pOp->p2];-
1943 iCompare = 1; /* Operands are not equal */-
1944 memAboutToChange(p, pOut);-
1945 MemSetTypeFlag(pOut, MEM_Null);-
1946 REGISTER_TRACE(pOp->p2, pOut);-
1947 }else{
executed 1810 times by 1 test: end of block
Executed by:
  • Self test (438)
1810
1948 VdbeBranchTaken(2,3);-
1949 if( pOp->p5 & SQLITE_JUMPIFNULL ){
pOp->p5 & 0x10Description<