OpenCoverage

func.c

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/sqlite/src/src/func.c
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6static CollSeq *sqlite3GetFuncCollSeq(sqlite3_context *context){-
7 VdbeOp *pOp;-
8 -
9 ((void) (0))-
10 ;-
11 pOp = &context->pVdbe->aOp[context->iOp-1];-
12 -
13 ((void) (0))-
14 ;-
15 -
16 ((void) (0))-
17 ;-
18 return
executed 458361 times by 1 test: return pOp->p4.pColl;
Executed by:
  • Self test (438)
pOp->p4.pColl;
executed 458361 times by 1 test: return pOp->p4.pColl;
Executed by:
  • Self test (438)
458361
19}-
20-
21-
22-
23-
24-
25static void sqlite3SkipAccumulatorLoad(sqlite3_context *context){-
26 -
27 ((void) (0))-
28 ;-
29 context->isError = -1;-
30 context->skipFlag = 1;-
31}
executed 69306 times by 1 test: end of block
Executed by:
  • Self test (438)
69306
32-
33-
34-
35-
36static void minmaxFunc(-
37 sqlite3_context *context,-
38 int argc,-
39 sqlite3_value **argv-
40){-
41 int i;-
42 int mask;-
43 int iBest;-
44 CollSeq *pColl;-
45-
46 -
47 ((void) (0))-
48 ;-
49 mask = sqlite3_user_data(context)==0
sqlite3_user_data(context)==0Description
TRUEevaluated 44495 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 43060 times by 1 test
Evaluated by:
  • Self test (438)
? 0 : -1;
43060-44495
50 pColl = sqlite3GetFuncCollSeq(context);-
51 -
52 ((void) (0))-
53 ;-
54 -
55 ((void) (0))-
56 ;-
57 iBest = 0;-
58 if( sqlite3_value_type(argv[0])==5
sqlite3_value_type(argv[0])==5Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 87547 times by 1 test
Evaluated by:
  • Self test (438)
) return;
executed 8 times by 1 test: return;
Executed by:
  • Self test (438)
8-87547
59 for(i=1; i<argc
i<argcDescription
TRUEevaluated 87572 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 87545 times by 1 test
Evaluated by:
  • Self test (438)
; i++){
87545-87572
60 if( sqlite3_value_type(argv[i])==5
sqlite3_value_type(argv[i])==5Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 87570 times by 1 test
Evaluated by:
  • Self test (438)
) return;
executed 2 times by 1 test: return;
Executed by:
  • Self test (438)
2-87570
61 if( (
(sqlite3MemCom...Coll)^mask)>=0Description
TRUEevaluated 43409 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 44161 times by 1 test
Evaluated by:
  • Self test (438)
sqlite3MemCompare(argv[iBest], argv[i], pColl)^mask)>=0
(sqlite3MemCom...Coll)^mask)>=0Description
TRUEevaluated 43409 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 44161 times by 1 test
Evaluated by:
  • Self test (438)
){
43409-44161
62 ;-
63 iBest = i;-
64 }
executed 43409 times by 1 test: end of block
Executed by:
  • Self test (438)
43409
65 }
executed 87570 times by 1 test: end of block
Executed by:
  • Self test (438)
87570
66 sqlite3_result_value(context, argv[iBest]);-
67}
executed 87545 times by 1 test: end of block
Executed by:
  • Self test (438)
87545
68-
69-
70-
71-
72static void typeofFunc(-
73 sqlite3_context *context,-
74 int NotUsed,-
75 sqlite3_value **argv-
76){-
77 static const char *azType[] = { "integer", "real", "text", "blob", "null" };-
78 int i = sqlite3_value_type(argv[0]) - 1;-
79 (void)(NotUsed);-
80 -
81 ((void) (0))-
82 ;-
83 -
84 ((void) (0))-
85 ;-
86 -
87 ((void) (0))-
88 ;-
89 -
90 ((void) (0))-
91 ;-
92 -
93 ((void) (0))-
94 ;-
95 -
96 ((void) (0))-
97 ;-
98-
99-
100-
101-
102 sqlite3_result_text(context, azType[i], -1, ((sqlite3_destructor_type)0));-
103}
executed 6310 times by 1 test: end of block
Executed by:
  • Self test (438)
6310
104-
105-
106-
107-
108-
109static void lengthFunc(-
110 sqlite3_context *context,-
111 int argc,-
112 sqlite3_value **argv-
113){-
114 -
115 ((void) (0))-
116 ;-
117 (void)(argc);-
118 switch( sqlite3_value_type(argv[0]) ){-
119 case
executed 11509 times by 1 test: case 4:
Executed by:
  • Self test (438)
4:
executed 11509 times by 1 test: case 4:
Executed by:
  • Self test (438)
11509
120 case
executed 12 times by 1 test: case 1:
Executed by:
  • Self test (438)
1:
executed 12 times by 1 test: case 1:
Executed by:
  • Self test (438)
12
121 case
executed 2 times by 1 test: case 2:
Executed by:
  • Self test (438)
2:
executed 2 times by 1 test: case 2:
Executed by:
  • Self test (438)
{
2
122 sqlite3_result_int(context, sqlite3_value_bytes(argv[0]));-
123 break;
executed 11523 times by 1 test: break;
Executed by:
  • Self test (438)
11523
124 }-
125 case
executed 19351 times by 1 test: case 3:
Executed by:
  • Self test (438)
3:
executed 19351 times by 1 test: case 3:
Executed by:
  • Self test (438)
{
19351
126 const unsigned char *z = sqlite3_value_text(argv[0]);-
127 const unsigned char *z0;-
128 unsigned char c;-
129 if( z==0
z==0Description
TRUEnever evaluated
FALSEevaluated 19351 times by 1 test
Evaluated by:
  • Self test (438)
) return;
never executed: return;
0-19351
130 z0 = z;-
131 while( (
(c = *z)!=0Description
TRUEevaluated 21462987 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 19351 times by 1 test
Evaluated by:
  • Self test (438)
c = *z)!=0
(c = *z)!=0Description
TRUEevaluated 21462987 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 19351 times by 1 test
Evaluated by:
  • Self test (438)
){
19351-21462987
132 z++;-
133 if( c>=0xc0
c>=0xc0Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 21462980 times by 1 test
Evaluated by:
  • Self test (438)
){
7-21462980
134 while( (*
(*z & 0xc0)==0x80Description
TRUEevaluated 29 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 7 times by 1 test
Evaluated by:
  • Self test (438)
z & 0xc0)==0x80
(*z & 0xc0)==0x80Description
TRUEevaluated 29 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 7 times by 1 test
Evaluated by:
  • Self test (438)
){ z++; z0++; }
executed 29 times by 1 test: end of block
Executed by:
  • Self test (438)
7-29
135 }
executed 7 times by 1 test: end of block
Executed by:
  • Self test (438)
7
136 }
executed 21462987 times by 1 test: end of block
Executed by:
  • Self test (438)
21462987
137 sqlite3_result_int(context, (int)(z-z0));-
138 break;
executed 19351 times by 1 test: break;
Executed by:
  • Self test (438)
19351
139 }-
140 default
executed 10 times by 1 test: default:
Executed by:
  • Self test (438)
:
executed 10 times by 1 test: default:
Executed by:
  • Self test (438)
{
10
141 sqlite3_result_null(context);-
142 break;
executed 10 times by 1 test: break;
Executed by:
  • Self test (438)
10
143 }-
144 }-
145}-
146-
147-
148-
149-
150-
151-
152-
153static void absFunc(sqlite3_context *context, int argc, sqlite3_value **argv){-
154 -
155 ((void) (0))-
156 ;-
157 (void)(argc);-
158 switch( sqlite3_value_type(argv[0]) ){-
159 case
executed 5280 times by 1 test: case 1:
Executed by:
  • Self test (438)
1:
executed 5280 times by 1 test: case 1:
Executed by:
  • Self test (438)
{
5280
160 i64 iVal = sqlite3_value_int64(argv[0]);-
161 if( iVal<0
iVal<0Description
TRUEevaluated 641 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 4639 times by 1 test
Evaluated by:
  • Self test (438)
){
641-4639
162 if( iVal==(((i64)-1) - (0xffffffff|(((i64)0x7fffffff)<<32)))
iVal==(((i64)-...ffffff)<<32)))Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 640 times by 1 test
Evaluated by:
  • Self test (438)
){
1-640
163-
164-
165-
166 sqlite3_result_error(context, "integer overflow", -1);-
167 return;
executed 1 time by 1 test: return;
Executed by:
  • Self test (438)
1
168 }-
169 iVal = -iVal;-
170 }
executed 640 times by 1 test: end of block
Executed by:
  • Self test (438)
640
171 sqlite3_result_int64(context, iVal);-
172 break;
executed 5279 times by 1 test: break;
Executed by:
  • Self test (438)
5279
173 }-
174 case
executed 19 times by 1 test: case 5:
Executed by:
  • Self test (438)
5:
executed 19 times by 1 test: case 5:
Executed by:
  • Self test (438)
{
19
175-
176 sqlite3_result_null(context);-
177 break;
executed 19 times by 1 test: break;
Executed by:
  • Self test (438)
19
178 }-
179 default
executed 17 times by 1 test: default:
Executed by:
  • Self test (438)
:
executed 17 times by 1 test: default:
Executed by:
  • Self test (438)
{
17
180-
181-
182-
183-
184-
185 double rVal = sqlite3_value_double(argv[0]);-
186 if( rVal<0
rVal<0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 15 times by 1 test
Evaluated by:
  • Self test (438)
) rVal = -rVal;
executed 2 times by 1 test: rVal = -rVal;
Executed by:
  • Self test (438)
2-15
187 sqlite3_result_double(context, rVal);-
188 break;
executed 17 times by 1 test: break;
Executed by:
  • Self test (438)
17
189 }-
190 }-
191}-
192static void instrFunc(-
193 sqlite3_context *context,-
194 int argc,-
195 sqlite3_value **argv-
196){-
197 const unsigned char *zHaystack;-
198 const unsigned char *zNeedle;-
199 int nHaystack;-
200 int nNeedle;-
201 int typeHaystack, typeNeedle;-
202 int N = 1;-
203 int isText;-
204-
205 (void)(argc);-
206 typeHaystack = sqlite3_value_type(argv[0]);-
207 typeNeedle = sqlite3_value_type(argv[1]);-
208 if( typeHaystack==5
typeHaystack==5Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 4705 times by 1 test
Evaluated by:
  • Self test (438)
|| typeNeedle==5
typeNeedle==5Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 4703 times by 1 test
Evaluated by:
  • Self test (438)
) return;
executed 5 times by 1 test: return;
Executed by:
  • Self test (438)
2-4705
209 nHaystack = sqlite3_value_bytes(argv[0]);-
210 nNeedle = sqlite3_value_bytes(argv[1]);-
211 if( nNeedle>0
nNeedle>0Description
TRUEevaluated 4699 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 4 times by 1 test
Evaluated by:
  • Self test (438)
){
4-4699
212 if( typeHaystack==4
typeHaystack==4Description
TRUEevaluated 20 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 4679 times by 1 test
Evaluated by:
  • Self test (438)
&& typeNeedle==4
typeNeedle==4Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test (438)
){
5-4679
213 zHaystack = sqlite3_value_blob(argv[0]);-
214 zNeedle = sqlite3_value_blob(argv[1]);-
215 isText = 0;-
216 }
executed 15 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
15
217 zHaystack = sqlite3_value_text(argv[0]);-
218 zNeedle = sqlite3_value_text(argv[1]);-
219 isText = 1;-
220 }
executed 4684 times by 1 test: end of block
Executed by:
  • Self test (438)
4684
221 if( zNeedle==0
zNeedle==0Description
TRUEnever evaluated
FALSEevaluated 4699 times by 1 test
Evaluated by:
  • Self test (438)
|| (nHaystack
nHaystackDescription
TRUEevaluated 4697 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
&& zHaystack==0
zHaystack==0Description
TRUEnever evaluated
FALSEevaluated 4697 times by 1 test
Evaluated by:
  • Self test (438)
) ) return;
never executed: return;
0-4699
222 while( nNeedle<=nHaystack
nNeedle<=nHaystackDescription
TRUEevaluated 1006645 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 21 times by 1 test
Evaluated by:
  • Self test (438)
&& memcmp(zHaystack, zNeedle, nNeedle)!=0
memcmp(zHaysta...e, nNeedle)!=0Description
TRUEevaluated 1001967 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 4678 times by 1 test
Evaluated by:
  • Self test (438)
){
21-1006645
223 N++;-
224 do{-
225 nHaystack--;-
226 zHaystack++;-
227 }
executed 1018369 times by 1 test: end of block
Executed by:
  • Self test (438)
while( isText
isTextDescription
TRUEevaluated 1018329 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 40 times by 1 test
Evaluated by:
  • Self test (438)
&& (
(zHaystack[0]&0xc0)==0x80Description
TRUEevaluated 16402 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1001927 times by 1 test
Evaluated by:
  • Self test (438)
zHaystack[0]&0xc0)==0x80
(zHaystack[0]&0xc0)==0x80Description
TRUEevaluated 16402 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1001927 times by 1 test
Evaluated by:
  • Self test (438)
);
40-1018369
228 }
executed 1001967 times by 1 test: end of block
Executed by:
  • Self test (438)
1001967
229 if( nNeedle>nHaystack
nNeedle>nHaystackDescription
TRUEevaluated 21 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 4678 times by 1 test
Evaluated by:
  • Self test (438)
) N = 0;
executed 21 times by 1 test: N = 0;
Executed by:
  • Self test (438)
21-4678
230 }
executed 4699 times by 1 test: end of block
Executed by:
  • Self test (438)
4699
231 sqlite3_result_int(context, N);-
232}
executed 4703 times by 1 test: end of block
Executed by:
  • Self test (438)
4703
233-
234-
235-
236-
237static void printfFunc(-
238 sqlite3_context *context,-
239 int argc,-
240 sqlite3_value **argv-
241){-
242 PrintfArguments x;-
243 StrAccum str;-
244 const char *zFormat;-
245 int n;-
246 sqlite3 *db = sqlite3_context_db_handle(context);-
247-
248 if( argc>=1
argc>=1Description
TRUEevaluated 12013 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
&& (
(zFormat = (co...t(argv[0]))!=0Description
TRUEevaluated 12012 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
zFormat = (const char*)sqlite3_value_text(argv[0]))!=0
(zFormat = (co...t(argv[0]))!=0Description
TRUEevaluated 12012 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
){
1-12013
249 x.nArg = argc-1;-
250 x.nUsed = 0;-
251 x.apArg = argv+1;-
252 sqlite3StrAccumInit(&str, db, 0, 0, db->aLimit[0]);-
253 str.printfFlags = 0x02;-
254 sqlite3_str_appendf(&str, zFormat, &x);-
255 n = str.nChar;-
256 sqlite3_result_text(context, sqlite3StrAccumFinish(&str), n,-
257 ((sqlite3_destructor_type)sqlite3MallocSize));-
258 }
executed 12012 times by 1 test: end of block
Executed by:
  • Self test (438)
12012
259}
executed 12014 times by 1 test: end of block
Executed by:
  • Self test (438)
12014
260static void substrFunc(-
261 sqlite3_context *context,-
262 int argc,-
263 sqlite3_value **argv-
264){-
265 const unsigned char *z;-
266 const unsigned char *z2;-
267 int len;-
268 int p0type;-
269 i64 p1, p2;-
270 int negP2 = 0;-
271-
272 -
273 ((void) (0))-
274 ;-
275 if( sqlite3_value_type(argv[1])==5
sqlite3_value_type(argv[1])==5Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 433356 times by 1 test
Evaluated by:
  • Self test (438)
2-433356
276 || (argc==3
argc==3Description
TRUEevaluated 423686 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 9670 times by 1 test
Evaluated by:
  • Self test (438)
&& sqlite3_value_type(argv[2])==5
sqlite3_value_type(argv[2])==5Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 423685 times by 1 test
Evaluated by:
  • Self test (438)
)
1-423686
277 ){-
278 return;
executed 3 times by 1 test: return;
Executed by:
  • Self test (438)
3
279 }-
280 p0type = sqlite3_value_type(argv[0]);-
281 p1 = sqlite3_value_int(argv[1]);-
282 if( p0type==4
p0type==4Description
TRUEevaluated 79 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 433276 times by 1 test
Evaluated by:
  • Self test (438)
){
79-433276
283 len = sqlite3_value_bytes(argv[0]);-
284 z = sqlite3_value_blob(argv[0]);-
285 if( z==0
z==0Description
TRUEnever evaluated
FALSEevaluated 79 times by 1 test
Evaluated by:
  • Self test (438)
) return;
never executed: return;
0-79
286 -
287 ((void) (0))-
288 ;-
289 }
executed 79 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
79
290 z = sqlite3_value_text(argv[0]);-
291 if( z==0
z==0Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 433270 times by 1 test
Evaluated by:
  • Self test (438)
) return;
executed 6 times by 1 test: return;
Executed by:
  • Self test (438)
6-433270
292 len = 0;-
293 if( p1<0
p1<0Description
TRUEevaluated 165 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 433105 times by 1 test
Evaluated by:
  • Self test (438)
){
165-433105
294 for(z2=z; *
*z2Description
TRUEevaluated 23024 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 165 times by 1 test
Evaluated by:
  • Self test (438)
z2
*z2Description
TRUEevaluated 23024 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 165 times by 1 test
Evaluated by:
  • Self test (438)
; len++){
165-23024
295 { if( (*(
(*(z2++))>=0xc0Description
TRUEevaluated 25 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 22999 times by 1 test
Evaluated by:
  • Self test (438)
z2++))>=0xc0
(*(z2++))>=0xc0Description
TRUEevaluated 25 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 22999 times by 1 test
Evaluated by:
  • Self test (438)
){ while( (*
(*z2 & 0xc0)==0x80Description
TRUEevaluated 50 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 25 times by 1 test
Evaluated by:
  • Self test (438)
z2 & 0xc0)==0x80
(*z2 & 0xc0)==0x80Description
TRUEevaluated 50 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 25 times by 1 test
Evaluated by:
  • Self test (438)
){ z2++; }
executed 50 times by 1 test: end of block
Executed by:
  • Self test (438)
}
executed 25 times by 1 test: end of block
Executed by:
  • Self test (438)
};
25-22999
296 }
executed 23024 times by 1 test: end of block
Executed by:
  • Self test (438)
23024
297 }
executed 165 times by 1 test: end of block
Executed by:
  • Self test (438)
165
298 }
executed 433270 times by 1 test: end of block
Executed by:
  • Self test (438)
433270
299 if( argc==3
argc==3Description
TRUEevaluated 423680 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 9669 times by 1 test
Evaluated by:
  • Self test (438)
){
9669-423680
300 p2 = sqlite3_value_int(argv[2]);-
301 if( p2<0
p2<0Description
TRUEevaluated 36 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 423644 times by 1 test
Evaluated by:
  • Self test (438)
){
36-423644
302 p2 = -p2;-
303 negP2 = 1;-
304 }
executed 36 times by 1 test: end of block
Executed by:
  • Self test (438)
36
305 }
executed 423680 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
423680
306 p2 = sqlite3_context_db_handle(context)->aLimit[0];-
307 }
executed 9669 times by 1 test: end of block
Executed by:
  • Self test (438)
9669
308 if( p1<0
p1<0Description
TRUEevaluated 196 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 433153 times by 1 test
Evaluated by:
  • Self test (438)
){
196-433153
309 p1 += len;-
310 if( p1<0
p1<0Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 181 times by 1 test
Evaluated by:
  • Self test (438)
){
15-181
311 p2 += p1;-
312 if( p2<0
p2<0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 13 times by 1 test
Evaluated by:
  • Self test (438)
) p2 = 0;
executed 2 times by 1 test: p2 = 0;
Executed by:
  • Self test (438)
2-13
313 p1 = 0;-
314 }
executed 15 times by 1 test: end of block
Executed by:
  • Self test (438)
15
315 }
executed 196 times by 1 test: end of block
Executed by:
  • Self test (438)
else if( p1>0
p1>0Description
TRUEevaluated 433123 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 30 times by 1 test
Evaluated by:
  • Self test (438)
){
30-433123
316 p1--;-
317 }
executed 433123 times by 1 test: end of block
Executed by:
  • Self test (438)
else if( p2>0
p2>0Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 4 times by 1 test
Evaluated by:
  • Self test (438)
){
4-433123
318 p2--;-
319 }
executed 26 times by 1 test: end of block
Executed by:
  • Self test (438)
26
320 if( negP2
negP2Description
TRUEevaluated 36 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 433313 times by 1 test
Evaluated by:
  • Self test (438)
){
36-433313
321 p1 -= p2;-
322 if( p1<0
p1<0Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 22 times by 1 test
Evaluated by:
  • Self test (438)
){
14-22
323 p2 += p1;-
324 p1 = 0;-
325 }
executed 14 times by 1 test: end of block
Executed by:
  • Self test (438)
14
326 }
executed 36 times by 1 test: end of block
Executed by:
  • Self test (438)
36
327 -
328 ((void) (0))-
329 ;-
330 if( p0type!=4
p0type!=4Description
TRUEevaluated 433270 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 79 times by 1 test
Evaluated by:
  • Self test (438)
){
79-433270
331 while( *
*zDescription
TRUEevaluated 12799701 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 16 times by 1 test
Evaluated by:
  • Self test (438)
z
*zDescription
TRUEevaluated 12799701 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 16 times by 1 test
Evaluated by:
  • Self test (438)
&& p1
p1Description
TRUEevaluated 12366447 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 433254 times by 1 test
Evaluated by:
  • Self test (438)
){
16-12799701
332 { if( (*(
(*(z++))>=0xc0Description
TRUEevaluated 22 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 12366425 times by 1 test
Evaluated by:
  • Self test (438)
z++))>=0xc0
(*(z++))>=0xc0Description
TRUEevaluated 22 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 12366425 times by 1 test
Evaluated by:
  • Self test (438)
){ while( (*
(*z & 0xc0)==0x80Description
TRUEevaluated 36 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 22 times by 1 test
Evaluated by:
  • Self test (438)
z & 0xc0)==0x80
(*z & 0xc0)==0x80Description
TRUEevaluated 36 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 22 times by 1 test
Evaluated by:
  • Self test (438)
){ z++; }
executed 36 times by 1 test: end of block
Executed by:
  • Self test (438)
}
executed 22 times by 1 test: end of block
Executed by:
  • Self test (438)
};
22-12366425
333 p1--;-
334 }
executed 12366447 times by 1 test: end of block
Executed by:
  • Self test (438)
12366447
335 for(z2=z; *
*z2Description
TRUEevaluated 1702127 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 10320 times by 1 test
Evaluated by:
  • Self test (438)
z2
*z2Description
TRUEevaluated 1702127 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 10320 times by 1 test
Evaluated by:
  • Self test (438)
&& p2
p2Description
TRUEevaluated 1279177 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 422950 times by 1 test
Evaluated by:
  • Self test (438)
; p2--){
10320-1702127
336 { if( (*(
(*(z2++))>=0xc0Description
TRUEevaluated 41 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1279136 times by 1 test
Evaluated by:
  • Self test (438)
z2++))>=0xc0
(*(z2++))>=0xc0Description
TRUEevaluated 41 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1279136 times by 1 test
Evaluated by:
  • Self test (438)
){ while( (*
(*z2 & 0xc0)==0x80Description
TRUEevaluated 78 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 41 times by 1 test
Evaluated by:
  • Self test (438)
z2 & 0xc0)==0x80
(*z2 & 0xc0)==0x80Description
TRUEevaluated 78 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 41 times by 1 test
Evaluated by:
  • Self test (438)
){ z2++; }
executed 78 times by 1 test: end of block
Executed by:
  • Self test (438)
}
executed 41 times by 1 test: end of block
Executed by:
  • Self test (438)
};
41-1279136
337 }
executed 1279177 times by 1 test: end of block
Executed by:
  • Self test (438)
1279177
338 sqlite3_result_text64(context, (char*)z, z2-z, ((sqlite3_destructor_type)-1),-
339 1);-
340 }
executed 433270 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
433270
341 if( p1+p2>len
p1+p2>lenDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 67 times by 1 test
Evaluated by:
  • Self test (438)
){
12-67
342 p2 = len-p1;-
343 if( p2<0
p2<0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test (438)
) p2 = 0;
executed 4 times by 1 test: p2 = 0;
Executed by:
  • Self test (438)
4-8
344 }
executed 12 times by 1 test: end of block
Executed by:
  • Self test (438)
12
345 sqlite3_result_blob64(context, (char*)&z[p1], (u64)p2, ((sqlite3_destructor_type)-1));-
346 }
executed 79 times by 1 test: end of block
Executed by:
  • Self test (438)
79
347}-
348-
349-
350-
351-
352-
353static void roundFunc(sqlite3_context *context, int argc, sqlite3_value **argv){-
354 int n = 0;-
355 double r;-
356 char *zBuf;-
357 -
358 ((void) (0))-
359 ;-
360 if( argc==2
argc==2Description
TRUEevaluated 1129 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 5297 times by 1 test
Evaluated by:
  • Self test (438)
){
1129-5297
361 if( 5==sqlite3_value_type(argv[1])
5==sqlite3_value_type(argv[1])Description
TRUEnever evaluated
FALSEevaluated 1129 times by 1 test
Evaluated by:
  • Self test (438)
) return;
never executed: return;
0-1129
362 n = sqlite3_value_int(argv[1]);-
363 if( n>30
n>30Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1126 times by 1 test
Evaluated by:
  • Self test (438)
) n = 30;
executed 3 times by 1 test: n = 30;
Executed by:
  • Self test (438)
3-1126
364 if( n<0
n<0Description
TRUEnever evaluated
FALSEevaluated 1129 times by 1 test
Evaluated by:
  • Self test (438)
) n = 0;
never executed: n = 0;
0-1129
365 }
executed 1129 times by 1 test: end of block
Executed by:
  • Self test (438)
1129
366 if( sqlite3_value_type(argv[0])==5
sqlite3_value_type(argv[0])==5Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 6422 times by 1 test
Evaluated by:
  • Self test (438)
) return;
executed 4 times by 1 test: return;
Executed by:
  • Self test (438)
4-6422
367 r = sqlite3_value_double(argv[0]);-
368-
369-
370-
371-
372 if( n==0
n==0Description
TRUEevaluated 5298 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1124 times by 1 test
Evaluated by:
  • Self test (438)
&& r>=0
r>=0Description
TRUEevaluated 5295 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 3 times by 1 test
Evaluated by:
  • Self test (438)
&& r<(0xffffffff|(((i64)0x7fffffff)<<32))-1
r<(0xffffffff|...fffff)<<32))-1Description
TRUEevaluated 5295 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-5298
373 r = (double)((sqlite_int64)(r+0.5));-
374 }
executed 5295 times by 1 test: end of block
Executed by:
  • Self test (438)
else if( n==0
n==0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1124 times by 1 test
Evaluated by:
  • Self test (438)
&& r<0
r<0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
&& (-
(-r)<(0xffffff...fffff)<<32))-1Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
r)<(0xffffffff|(((i64)0x7fffffff)<<32))-1
(-r)<(0xffffff...fffff)<<32))-1Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-5295
375 r = -(double)((sqlite_int64)((-r)+0.5));-
376 }
executed 3 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
3
377 zBuf = sqlite3_mprintf("%.*f",n,r);-
378 if( zBuf==0
zBuf==0Description
TRUEnever evaluated
FALSEevaluated 1124 times by 1 test
Evaluated by:
  • Self test (438)
){
0-1124
379 sqlite3_result_error_nomem(context);-
380 return;
never executed: return;
0
381 }-
382 sqlite3AtoF(zBuf, &r, sqlite3Strlen30(zBuf), 1);-
383 sqlite3_free(zBuf);-
384 }
executed 1124 times by 1 test: end of block
Executed by:
  • Self test (438)
1124
385 sqlite3_result_double(context, r);-
386}
executed 6422 times by 1 test: end of block
Executed by:
  • Self test (438)
6422
387static void *contextMalloc(sqlite3_context *context, i64 nByte){-
388 char *z;-
389 sqlite3 *db = sqlite3_context_db_handle(context);-
390 -
391 ((void) (0))-
392 ;-
393 ;-
394 ;-
395 if( nByte>db->aLimit[0]
nByte>db->aLimit[0]Description
TRUEnever evaluated
FALSEevaluated 1321545 times by 364 tests
Evaluated 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)
  • ...
){
0-1321545
396 sqlite3_result_error_toobig(context);-
397 z = 0;-
398 }
never executed: end of block
else{
0
399 z = sqlite3Malloc(nByte);-
400 if( !z
!zDescription
TRUEnever evaluated
FALSEevaluated 1321545 times by 364 tests
Evaluated 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)
  • ...
){
0-1321545
401 sqlite3_result_error_nomem(context);-
402 }
never executed: end of block
0
403 }
executed 1321545 times by 364 tests: end of block
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)
  • ...
1321545
404 return
executed 1321545 times by 364 tests: return z;
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)
  • ...
z;
executed 1321545 times by 364 tests: return z;
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)
  • ...
1321545
405}-
406-
407-
408-
409-
410static void upperFunc(sqlite3_context *context, int argc, sqlite3_value **argv){-
411 char *z1;-
412 const char *z2;-
413 int i, n;-
414 (void)(argc);-
415 z2 = (char*)sqlite3_value_text(argv[0]);-
416 n = sqlite3_value_bytes(argv[0]);-
417-
418 -
419 ((void) (0))-
420 ;-
421 if( z2
z2Description
TRUEevaluated 45 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 4 times by 1 test
Evaluated by:
  • Self test (438)
){
4-45
422 z1 = contextMalloc(context, ((i64)n)+1);-
423 if( z1
z1Description
TRUEevaluated 45 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-45
424 for(i=0; i<n
i<nDescription
TRUEevaluated 136 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 45 times by 1 test
Evaluated by:
  • Self test (438)
; i++){
45-136
425 z1[i] = (char)((z2[i])&~(sqlite3CtypeMap[(unsigned char)(z2[i])]&0x20));-
426 }
executed 136 times by 1 test: end of block
Executed by:
  • Self test (438)
136
427 sqlite3_result_text(context, z1, n, sqlite3_free);-
428 }
executed 45 times by 1 test: end of block
Executed by:
  • Self test (438)
45
429 }
executed 45 times by 1 test: end of block
Executed by:
  • Self test (438)
45
430}
executed 49 times by 1 test: end of block
Executed by:
  • Self test (438)
49
431static void lowerFunc(sqlite3_context *context, int argc, sqlite3_value **argv){-
432 char *z1;-
433 const char *z2;-
434 int i, n;-
435 (void)(argc);-
436 z2 = (char*)sqlite3_value_text(argv[0]);-
437 n = sqlite3_value_bytes(argv[0]);-
438-
439 -
440 ((void) (0))-
441 ;-
442 if( z2
z2Description
TRUEevaluated 69 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 11 times by 1 test
Evaluated by:
  • Self test (438)
){
11-69
443 z1 = contextMalloc(context, ((i64)n)+1);-
444 if( z1
z1Description
TRUEevaluated 69 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-69
445 for(i=0; i<n
i<nDescription
TRUEevaluated 227 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 69 times by 1 test
Evaluated by:
  • Self test (438)
; i++){
69-227
446 z1[i] = (sqlite3UpperToLower[(unsigned char)(z2[i])]);-
447 }
executed 227 times by 1 test: end of block
Executed by:
  • Self test (438)
227
448 sqlite3_result_text(context, z1, n, sqlite3_free);-
449 }
executed 69 times by 1 test: end of block
Executed by:
  • Self test (438)
69
450 }
executed 69 times by 1 test: end of block
Executed by:
  • Self test (438)
69
451}
executed 80 times by 1 test: end of block
Executed by:
  • Self test (438)
80
452static void randomFunc(-
453 sqlite3_context *context,-
454 int NotUsed,-
455 sqlite3_value **NotUsed2-
456){-
457 sqlite_int64 r;-
458 (void)(NotUsed),(void)(NotUsed2);-
459 sqlite3_randomness(sizeof(r), &r);-
460 if( r<0
r<0Description
TRUEevaluated 361308 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 361765 times by 1 test
Evaluated by:
  • Self test (438)
){
361308-361765
461 r = -(r & (0xffffffff|(((i64)0x7fffffff)<<32)));-
462 }
executed 361308 times by 1 test: end of block
Executed by:
  • Self test (438)
361308
463 sqlite3_result_int64(context, r);-
464}
executed 723073 times by 1 test: end of block
Executed by:
  • Self test (438)
723073
465-
466-
467-
468-
469-
470static void randomBlob(-
471 sqlite3_context *context,-
472 int argc,-
473 sqlite3_value **argv-
474){-
475 int n;-
476 unsigned char *p;-
477 -
478 ((void) (0))-
479 ;-
480 (void)(argc);-
481 n = sqlite3_value_int(argv[0]);-
482 if( n<1
n<1Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1282287 times by 363 tests
Evaluated 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)
  • ...
){
1-1282287
483 n = 1;-
484 }
executed 1 time by 1 test: end of block
Executed by:
  • Self test (438)
1
485 p = contextMalloc(context, n);-
486 if( p
pDescription
TRUEevaluated 1282288 times by 363 tests
Evaluated 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)
  • ...
FALSEnever evaluated
){
0-1282288
487 sqlite3_randomness(n, p);-
488 sqlite3_result_blob(context, (char*)p, n, sqlite3_free);-
489 }
executed 1282288 times by 363 tests: end of block
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)
  • ...
1282288
490}
executed 1282288 times by 363 tests: end of block
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)
  • ...
1282288
491-
492-
493-
494-
495-
496static void last_insert_rowid(-
497 sqlite3_context *context,-
498 int NotUsed,-
499 sqlite3_value **NotUsed2-
500){-
501 sqlite3 *db = sqlite3_context_db_handle(context);-
502 (void)(NotUsed),(void)(NotUsed2);-
503-
504-
505-
506 sqlite3_result_int64(context, sqlite3_last_insert_rowid(db));-
507}
executed 49 times by 1 test: end of block
Executed by:
  • Self test (438)
49
508static void changes(-
509 sqlite3_context *context,-
510 int NotUsed,-
511 sqlite3_value **NotUsed2-
512){-
513 sqlite3 *db = sqlite3_context_db_handle(context);-
514 (void)(NotUsed),(void)(NotUsed2);-
515 sqlite3_result_int(context, sqlite3_changes(db));-
516}
executed 66 times by 1 test: end of block
Executed by:
  • Self test (438)
66
517-
518-
519-
520-
521-
522static void total_changes(-
523 sqlite3_context *context,-
524 int NotUsed,-
525 sqlite3_value **NotUsed2-
526){-
527 sqlite3 *db = sqlite3_context_db_handle(context);-
528 (void)(NotUsed),(void)(NotUsed2);-
529-
530-
531 sqlite3_result_int(context, sqlite3_total_changes(db));-
532}
executed 5 times by 1 test: end of block
Executed by:
  • Self test (438)
5
533-
534-
535-
536-
537struct compareInfo {-
538 u8 matchAll;-
539 u8 matchOne;-
540 u8 matchSet;-
541 u8 noCase;-
542};-
543static const struct compareInfo globInfo = { '*', '?', '[', 0 };-
544-
545-
546static const struct compareInfo likeInfoNorm = { '%', '_', 0, 1 };-
547-
548-
549static const struct compareInfo likeInfoAlt = { '%', '_', 0, 0 };-
550static int patternCompare(-
551 const u8 *zPattern,-
552 const u8 *zString,-
553 const struct compareInfo *pInfo,-
554 u32 matchOther-
555){-
556 u32 c, c2;-
557 u32 matchOne = pInfo->matchOne;-
558 u32 matchAll = pInfo->matchAll;-
559 u8 noCase = pInfo->noCase;-
560 const u8 *zEscaped = 0;-
561-
562 while( (
(c = (zPattern...zPattern)))!=0Description
TRUEevaluated 64310 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1944 times by 1 test
Evaluated by:
  • Self test (438)
c = (zPattern[0]<0x80
zPattern[0]<0x80Description
TRUEevaluated 66166 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 88 times by 1 test
Evaluated by:
  • Self test (438)
?*(zPattern++):sqlite3Utf8Read(&zPattern)))!=0
(c = (zPattern...zPattern)))!=0Description
TRUEevaluated 64310 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1944 times by 1 test
Evaluated by:
  • Self test (438)
){
88-66166
563 if( c==matchAll
c==matchAllDescription
TRUEevaluated 4344 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 59966 times by 1 test
Evaluated by:
  • Self test (438)
){
4344-59966
564-
565-
566-
567 while( (
(c=(zPattern[0...)) == matchAllDescription
TRUEnever evaluated
FALSEevaluated 4354 times by 1 test
Evaluated by:
  • Self test (438)
c=(zPattern[0]<0x80
zPattern[0]<0x80Description
TRUEevaluated 4342 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 12 times by 1 test
Evaluated by:
  • Self test (438)
?*(zPattern++):sqlite3Utf8Read(&zPattern))) == matchAll
(c=(zPattern[0...)) == matchAllDescription
TRUEnever evaluated
FALSEevaluated 4354 times by 1 test
Evaluated by:
  • Self test (438)
|| c == matchOne
c == matchOneDescription
TRUEevaluated 11 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 4343 times by 1 test
Evaluated by:
  • Self test (438)
){
0-4354
568 if( c==matchOne
c==matchOneDescription
TRUEevaluated 11 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
&& sqlite3Utf8Read(&zString)==0
sqlite3Utf8Read(&zString)==0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 10 times by 1 test
Evaluated by:
  • Self test (438)
){
0-11
569 return
executed 1 time by 1 test: return 2;
Executed by:
  • Self test (438)
2;
executed 1 time by 1 test: return 2;
Executed by:
  • Self test (438)
1
570 }-
571 }
executed 10 times by 1 test: end of block
Executed by:
  • Self test (438)
10
572 if( c==0
c==0Description
TRUEevaluated 3823 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 520 times by 1 test
Evaluated by:
  • Self test (438)
){
520-3823
573 return
executed 3823 times by 1 test: return 0;
Executed by:
  • Self test (438)
0;
executed 3823 times by 1 test: return 0;
Executed by:
  • Self test (438)
3823
574 }else if( c==matchOther
c==matchOtherDescription
TRUEevaluated 21 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 499 times by 1 test
Evaluated by:
  • Self test (438)
){
21-499
575 if( pInfo->matchSet==0
pInfo->matchSet==0Description
TRUEevaluated 13 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test (438)
){
8-13
576 c = sqlite3Utf8Read(&zPattern);-
577 if( c==0
c==0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 12 times by 1 test
Evaluated by:
  • Self test (438)
) return
executed 1 time by 1 test: return 2;
Executed by:
  • Self test (438)
2;
executed 1 time by 1 test: return 2;
Executed by:
  • Self test (438)
1-12
578 }
executed 12 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
12
579-
580-
581 -
582 ((void) (0))-
583 ;-
584 while( *
*zStringDescription
TRUEevaluated 44 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 4 times by 1 test
Evaluated by:
  • Self test (438)
zString
*zStringDescription
TRUEevaluated 44 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 4 times by 1 test
Evaluated by:
  • Self test (438)
){
4-44
585 int bMatch = patternCompare(&zPattern[-1],zString,pInfo,matchOther);-
586 if( bMatch!=1
bMatch!=1Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 40 times by 1 test
Evaluated by:
  • Self test (438)
) return
executed 4 times by 1 test: return bMatch;
Executed by:
  • Self test (438)
bMatch;
executed 4 times by 1 test: return bMatch;
Executed by:
  • Self test (438)
4-40
587 { if( (*(
(*(zString++))>=0xc0Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • Self test (438)
zString++))>=0xc0
(*(zString++))>=0xc0Description
TRUEnever evaluated
FALSEevaluated 40 times by 1 test
Evaluated by:
  • Self test (438)
){ while( (*
(*zString & 0xc0)==0x80Description
TRUEnever evaluated
FALSEnever evaluated
zString & 0xc0)==0x80
(*zString & 0xc0)==0x80Description
TRUEnever evaluated
FALSEnever evaluated
){ zString++; }
never executed: end of block
}
never executed: end of block
};
0-40
588 }
executed 40 times by 1 test: end of block
Executed by:
  • Self test (438)
40
589 return
executed 4 times by 1 test: return 2;
Executed by:
  • Self test (438)
2;
executed 4 times by 1 test: return 2;
Executed by:
  • Self test (438)
4
590 }-
591 }-
592 if( c<=0x80
c<=0x80Description
TRUEevaluated 503 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test (438)
){
8-503
593 char zStop[3];-
594 int bMatch;-
595 if( noCase
noCaseDescription
TRUEevaluated 124 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 379 times by 1 test
Evaluated by:
  • Self test (438)
){
124-379
596 zStop[0] = ((c)&~(sqlite3CtypeMap[(unsigned char)(c)]&0x20));-
597 zStop[1] = (sqlite3UpperToLower[(unsigned char)(c)]);-
598 zStop[2] = 0;-
599 }
executed 124 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
124
600 zStop[0] = c;-
601 zStop[1] = 0;-
602 }
executed 379 times by 1 test: end of block
Executed by:
  • Self test (438)
379
603 while(1){-
604 zString += -
605 __builtin_strcspn (-
606 (const char*)zString-
607 , -
608 zStop-
609 )-
610 ;-
611 if( zString[0]==0
zString[0]==0Description
TRUEevaluated 406 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 209 times by 1 test
Evaluated by:
  • Self test (438)
) break;
executed 406 times by 1 test: break;
Executed by:
  • Self test (438)
209-406
612 zString++;-
613 bMatch = patternCompare(zPattern,zString,pInfo,matchOther);-
614 if( bMatch!=1
bMatch!=1Description
TRUEevaluated 97 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 112 times by 1 test
Evaluated by:
  • Self test (438)
) return
executed 97 times by 1 test: return bMatch;
Executed by:
  • Self test (438)
bMatch;
executed 97 times by 1 test: return bMatch;
Executed by:
  • Self test (438)
97-112
615 }
executed 112 times by 1 test: end of block
Executed by:
  • Self test (438)
112
616 }
executed 406 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
406
617 int bMatch;-
618 while( (
(c2 = (zString...&zString)))!=0Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
c2 = (zString[0]<0x80
zString[0]<0x80Description
TRUEevaluated 13 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 11 times by 1 test
Evaluated by:
  • Self test (438)
?*(zString++):sqlite3Utf8Read(&zString)))!=0
(c2 = (zString...&zString)))!=0Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-24
619 if( c2!=c
c2!=cDescription
TRUEevaluated 13 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 11 times by 1 test
Evaluated by:
  • Self test (438)
) continue;
executed 13 times by 1 test: continue;
Executed by:
  • Self test (438)
11-13
620 bMatch = patternCompare(zPattern,zString,pInfo,matchOther);-
621 if( bMatch!=1
bMatch!=1Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 3 times by 1 test
Evaluated by:
  • Self test (438)
) return
executed 8 times by 1 test: return bMatch;
Executed by:
  • Self test (438)
bMatch;
executed 8 times by 1 test: return bMatch;
Executed by:
  • Self test (438)
3-8
622 }
executed 3 times by 1 test: end of block
Executed by:
  • Self test (438)
3
623 }
never executed: end of block
0
624 return
executed 406 times by 1 test: return 2;
Executed by:
  • Self test (438)
2;
executed 406 times by 1 test: return 2;
Executed by:
  • Self test (438)
406
625 }-
626 if( c==matchOther
c==matchOtherDescription
TRUEevaluated 382 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 59584 times by 1 test
Evaluated by:
  • Self test (438)
){
382-59584
627 if( pInfo->matchSet==0
pInfo->matchSet==0Description
TRUEevaluated 272 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 110 times by 1 test
Evaluated by:
  • Self test (438)
){
110-272
628 c = sqlite3Utf8Read(&zPattern);-
629 if( c==0
c==0Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 269 times by 1 test
Evaluated by:
  • Self test (438)
) return
executed 3 times by 1 test: return 1;
Executed by:
  • Self test (438)
1;
executed 3 times by 1 test: return 1;
Executed by:
  • Self test (438)
3-269
630 zEscaped = zPattern;-
631 }
executed 269 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
269
632 u32 prior_c = 0;-
633 int seen = 0;-
634 int invert = 0;-
635 c = sqlite3Utf8Read(&zString);-
636 if( c==0
c==0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 109 times by 1 test
Evaluated by:
  • Self test (438)
) return
executed 1 time by 1 test: return 1;
Executed by:
  • Self test (438)
1;
executed 1 time by 1 test: return 1;
Executed by:
  • Self test (438)
1-109
637 c2 = sqlite3Utf8Read(&zPattern);-
638 if( c2=='^'
c2=='^'Description
TRUEevaluated 24 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 85 times by 1 test
Evaluated by:
  • Self test (438)
){
24-85
639 invert = 1;-
640 c2 = sqlite3Utf8Read(&zPattern);-
641 }
executed 24 times by 1 test: end of block
Executed by:
  • Self test (438)
24
642 if( c2==']'
c2==']'Description
TRUEevaluated 7 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 102 times by 1 test
Evaluated by:
  • Self test (438)
){
7-102
643 if( c==']'
c==']'Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test (438)
) seen = 1;
executed 2 times by 1 test: seen = 1;
Executed by:
  • Self test (438)
2-5
644 c2 = sqlite3Utf8Read(&zPattern);-
645 }
executed 7 times by 1 test: end of block
Executed by:
  • Self test (438)
7
646 while( c2
c2Description
TRUEevaluated 348 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
&& c2!=']'
c2!=']'Description
TRUEevaluated 239 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 109 times by 1 test
Evaluated by:
  • Self test (438)
){
0-348
647 if( c2=='-'
c2=='-'Description
TRUEevaluated 36 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 203 times by 1 test
Evaluated by:
  • Self test (438)
&& zPattern[0]!=']'
zPattern[0]!=']'Description
TRUEevaluated 36 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
&& zPattern[0]!=0
zPattern[0]!=0Description
TRUEevaluated 36 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
&& prior_c>0
prior_c>0Description
TRUEevaluated 36 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-203
648 c2 = sqlite3Utf8Read(&zPattern);-
649 if( c>=prior_c
c>=prior_cDescription
TRUEevaluated 31 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test (438)
&& c<=c2
c<=c2Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test (438)
) seen = 1;
executed 26 times by 1 test: seen = 1;
Executed by:
  • Self test (438)
5-31
650 prior_c = 0;-
651 }
executed 36 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
36
652 if( c==c2
c==c2Description
TRUEevaluated 37 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 166 times by 1 test
Evaluated by:
  • Self test (438)
){
37-166
653 seen = 1;-
654 }
executed 37 times by 1 test: end of block
Executed by:
  • Self test (438)
37
655 prior_c = c2;-
656 }
executed 203 times by 1 test: end of block
Executed by:
  • Self test (438)
203
657 c2 = sqlite3Utf8Read(&zPattern);-
658 }
executed 239 times by 1 test: end of block
Executed by:
  • Self test (438)
239
659 if( c2==0
c2==0Description
TRUEnever evaluated
FALSEevaluated 109 times by 1 test
Evaluated by:
  • Self test (438)
|| (
(seen ^ invert)==0Description
TRUEevaluated 47 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 62 times by 1 test
Evaluated by:
  • Self test (438)
seen ^ invert)==0
(seen ^ invert)==0Description
TRUEevaluated 47 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 62 times by 1 test
Evaluated by:
  • Self test (438)
){
0-109
660 return
executed 47 times by 1 test: return 1;
Executed by:
  • Self test (438)
1;
executed 47 times by 1 test: return 1;
Executed by:
  • Self test (438)
47
661 }-
662 continue;
executed 62 times by 1 test: continue;
Executed by:
  • Self test (438)
62
663 }-
664 }-
665 c2 = (zString[0]<0x80
zString[0]<0x80Description
TRUEevaluated 59799 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 54 times by 1 test
Evaluated by:
  • Self test (438)
?*(zString++):sqlite3Utf8Read(&zString));
54-59799
666 if( c==c2
c==c2Description
TRUEevaluated 25102 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 34751 times by 1 test
Evaluated by:
  • Self test (438)
) continue;
executed 25102 times by 1 test: continue;
Executed by:
  • Self test (438)
25102-34751
667 if( noCase
noCaseDescription
TRUEevaluated 26651 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 8100 times by 1 test
Evaluated by:
  • Self test (438)
&& (
(sqlite3UpperT...ed char)(c2)])Description
TRUEevaluated 5510 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 21141 times by 1 test
Evaluated by:
  • Self test (438)
sqlite3UpperToLower[(unsigned char)(c)])==(sqlite3UpperToLower[(unsigned char)(c2)])
(sqlite3UpperT...ed char)(c2)])Description
TRUEevaluated 5510 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 21141 times by 1 test
Evaluated by:
  • Self test (438)
&& c<0x80
c<0x80Description
TRUEevaluated 5508 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
&& c2<0x80
c2<0x80Description
TRUEevaluated 5507 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
){
1-26651
668 continue;
executed 5507 times by 1 test: continue;
Executed by:
  • Self test (438)
5507
669 }-
670 if( c==matchOne
c==matchOneDescription
TRUEevaluated 2087 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 27157 times by 1 test
Evaluated by:
  • Self test (438)
&& zPattern!=zEscaped
zPattern!=zEscapedDescription
TRUEevaluated 2070 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 17 times by 1 test
Evaluated by:
  • Self test (438)
&& c2!=0
c2!=0Description
TRUEevaluated 2057 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 13 times by 1 test
Evaluated by:
  • Self test (438)
) continue;
executed 2057 times by 1 test: continue;
Executed by:
  • Self test (438)
13-27157
671 return
executed 27187 times by 1 test: return 1;
Executed by:
  • Self test (438)
1;
executed 27187 times by 1 test: return 1;
Executed by:
  • Self test (438)
27187
672 }-
673 return
executed 1944 times by 1 test: return *zString==0 ? 0 : 1;
Executed by:
  • Self test (438)
*
*zString==0Description
TRUEevaluated 1796 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 148 times by 1 test
Evaluated by:
  • Self test (438)
zString==0
*zString==0Description
TRUEevaluated 1796 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 148 times by 1 test
Evaluated by:
  • Self test (438)
? 0 : 1;
executed 1944 times by 1 test: return *zString==0 ? 0 : 1;
Executed by:
  • Self test (438)
148-1944
674}-
675-
676-
677-
678-
679-
680int sqlite3_strglob(const char *zGlobPattern, const char *zString){-
681 return
executed 133 times by 1 test: return patternCompare((u8*)zGlobPattern, (u8*)zString, &globInfo, '[');
Executed by:
  • Self test (438)
patternCompare((u8*)zGlobPattern, (u8*)zString, &globInfo, '[');
executed 133 times by 1 test: return patternCompare((u8*)zGlobPattern, (u8*)zString, &globInfo, '[');
Executed by:
  • Self test (438)
133
682}-
683-
684-
685-
686-
687-
688int sqlite3_strlike(const char *zPattern, const char *zStr, unsigned int esc){-
689 return
executed 472 times by 1 test: return patternCompare((u8*)zPattern, (u8*)zStr, &likeInfoNorm, esc);
Executed by:
  • Self test (438)
patternCompare((u8*)zPattern, (u8*)zStr, &likeInfoNorm, esc);
executed 472 times by 1 test: return patternCompare((u8*)zPattern, (u8*)zStr, &likeInfoNorm, esc);
Executed by:
  • Self test (438)
472
690}-
691-
692-
693-
694-
695-
696-
697-
698int sqlite3_like_count = 0;-
699static void likeFunc(-
700 sqlite3_context *context,-
701 int argc,-
702 sqlite3_value **argv-
703){-
704 const unsigned char *zA, *zB;-
705 u32 escape;-
706 int nPat;-
707 sqlite3 *db = sqlite3_context_db_handle(context);-
708 struct compareInfo *pInfo = sqlite3_user_data(context);-
709 zB = sqlite3_value_text(argv[0]);-
710 zA = sqlite3_value_text(argv[1]);-
711-
712-
713-
714-
715 nPat = sqlite3_value_bytes(argv[0]);-
716 ;-
717 ;-
718 if( nPat > db->aLimit[8]
nPat > db->aLimit[8]Description
TRUEnever evaluated
FALSEevaluated 32960 times by 1 test
Evaluated by:
  • Self test (438)
){
0-32960
719 sqlite3_result_error(context, "LIKE or GLOB pattern too complex", -1);-
720 return;
never executed: return;
0
721 }-
722 -
723 ((void) (0))-
724 ;-
725-
726 if( argc==3
argc==3Description
TRUEevaluated 787 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 32173 times by 1 test
Evaluated by:
  • Self test (438)
){
787-32173
727-
728-
729-
730 const unsigned char *zEsc = sqlite3_value_text(argv[2]);-
731 if( zEsc==0
zEsc==0Description
TRUEnever evaluated
FALSEevaluated 787 times by 1 test
Evaluated by:
  • Self test (438)
) return;
never executed: return;
0-787
732 if( sqlite3Utf8CharLen((char*)zEsc, -1)!=1
sqlite3Utf8Cha...*)zEsc, -1)!=1Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 783 times by 1 test
Evaluated by:
  • Self test (438)
){
4-783
733 sqlite3_result_error(context,-
734 "ESCAPE expression must be a single character", -1);-
735 return;
executed 4 times by 1 test: return;
Executed by:
  • Self test (438)
4
736 }-
737 escape = sqlite3Utf8Read(&zEsc);-
738 }
executed 783 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
783
739 escape = pInfo->matchSet;-
740 }
executed 32173 times by 1 test: end of block
Executed by:
  • Self test (438)
32173
741 if( zA
zADescription
TRUEevaluated 32744 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 212 times by 1 test
Evaluated by:
  • Self test (438)
&& zB
zBDescription
TRUEevaluated 32657 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 87 times by 1 test
Evaluated by:
  • Self test (438)
){
87-32744
742-
743 sqlite3_like_count++;-
744-
745 sqlite3_result_int(context,-
746 patternCompare(zB, zA, pInfo, escape)==0);-
747 }
executed 32657 times by 1 test: end of block
Executed by:
  • Self test (438)
32657
748}
executed 32956 times by 1 test: end of block
Executed by:
  • Self test (438)
32956
749-
750-
751-
752-
753-
754-
755static void nullifFunc(-
756 sqlite3_context *context,-
757 int NotUsed,-
758 sqlite3_value **argv-
759){-
760 CollSeq *pColl = sqlite3GetFuncCollSeq(context);-
761 (void)(NotUsed);-
762 if( sqlite3MemCompare(argv[0], argv[1], pColl)!=0
sqlite3MemComp...[1], pColl)!=0Description
TRUEevaluated 131129 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 609 times by 1 test
Evaluated by:
  • Self test (438)
){
609-131129
763 sqlite3_result_value(context, argv[0]);-
764 }
executed 131129 times by 1 test: end of block
Executed by:
  • Self test (438)
131129
765}
executed 131738 times by 1 test: end of block
Executed by:
  • Self test (438)
131738
766-
767-
768-
769-
770-
771static void versionFunc(-
772 sqlite3_context *context,-
773 int NotUsed,-
774 sqlite3_value **NotUsed2-
775){-
776 (void)(NotUsed),(void)(NotUsed2);-
777-
778-
779 sqlite3_result_text(context, sqlite3_libversion(), -1, ((sqlite3_destructor_type)0));-
780}
executed 2 times by 1 test: end of block
Executed by:
  • Self test (438)
2
781-
782-
783-
784-
785-
786-
787static void sourceidFunc(-
788 sqlite3_context *context,-
789 int NotUsed,-
790 sqlite3_value **NotUsed2-
791){-
792 (void)(NotUsed),(void)(NotUsed2);-
793-
794-
795 sqlite3_result_text(context, sqlite3_sourceid(), -1, ((sqlite3_destructor_type)0));-
796}
executed 1 time by 1 test: end of block
Executed by:
  • Self test (438)
1
797-
798-
799-
800-
801-
802-
803static void errlogFunc(-
804 sqlite3_context *context,-
805 int argc,-
806 sqlite3_value **argv-
807){-
808 (void)(argc);-
809 (void)(context);-
810 sqlite3_log(sqlite3_value_int(argv[0]), "%s", sqlite3_value_text(argv[1]));-
811}
never executed: end of block
0
812-
813-
814-
815-
816-
817-
818-
819static void compileoptionusedFunc(-
820 sqlite3_context *context,-
821 int argc,-
822 sqlite3_value **argv-
823){-
824 const char *zOptName;-
825 -
826 ((void) (0))-
827 ;-
828 (void)(argc);-
829-
830-
831-
832-
833 if( (
(zOptName = (c...t(argv[0]))!=0Description
TRUEevaluated 25 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
zOptName = (const char*)sqlite3_value_text(argv[0]))!=0
(zOptName = (c...t(argv[0]))!=0Description
TRUEevaluated 25 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
){
1-25
834 sqlite3_result_int(context, sqlite3_compileoption_used(zOptName));-
835 }
executed 25 times by 1 test: end of block
Executed by:
  • Self test (438)
25
836}
executed 26 times by 1 test: end of block
Executed by:
  • Self test (438)
26
837static void compileoptiongetFunc(-
838 sqlite3_context *context,-
839 int argc,-
840 sqlite3_value **argv-
841){-
842 int n;-
843 -
844 ((void) (0))-
845 ;-
846 (void)(argc);-
847-
848-
849-
850 n = sqlite3_value_int(argv[0]);-
851 sqlite3_result_text(context, sqlite3_compileoption_get(n), -1, ((sqlite3_destructor_type)0));-
852}
executed 12 times by 1 test: end of block
Executed by:
  • Self test (438)
12
853-
854-
855-
856-
857static const char hexdigits[] = {-
858 '0', '1', '2', '3', '4', '5', '6', '7',-
859 '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'-
860};-
861static void quoteFunc(sqlite3_context *context, int argc, sqlite3_value **argv){-
862 -
863 ((void) (0))-
864 ;-
865 (void)(argc);-
866 switch( sqlite3_value_type(argv[0]) ){-
867 case
executed 20016 times by 1 test: case 2:
Executed by:
  • Self test (438)
2:
executed 20016 times by 1 test: case 2:
Executed by:
  • Self test (438)
{
20016
868 double r1, r2;-
869 char zBuf[50];-
870 r1 = sqlite3_value_double(argv[0]);-
871 sqlite3_snprintf(sizeof(zBuf), zBuf, "%!.15g", r1);-
872 sqlite3AtoF(zBuf, &r2, 20, 1);-
873 if( r1!=r2
r1!=r2Description
TRUEevaluated 18645 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1371 times by 1 test
Evaluated by:
  • Self test (438)
){
1371-18645
874 sqlite3_snprintf(sizeof(zBuf), zBuf, "%!.20e", r1);-
875 }
executed 18645 times by 1 test: end of block
Executed by:
  • Self test (438)
18645
876 sqlite3_result_text(context, zBuf, -1, ((sqlite3_destructor_type)-1));-
877 break;
executed 20016 times by 1 test: break;
Executed by:
  • Self test (438)
20016
878 }-
879 case
executed 53 times by 1 test: case 1:
Executed by:
  • Self test (438)
1:
executed 53 times by 1 test: case 1:
Executed by:
  • Self test (438)
{
53
880 sqlite3_result_value(context, argv[0]);-
881 break;
executed 53 times by 1 test: break;
Executed by:
  • Self test (438)
53
882 }-
883 case
executed 123 times by 1 test: case 4:
Executed by:
  • Self test (438)
4:
executed 123 times by 1 test: case 4:
Executed by:
  • Self test (438)
{
123
884 char *zText = 0;-
885 char const *zBlob = sqlite3_value_blob(argv[0]);-
886 int nBlob = sqlite3_value_bytes(argv[0]);-
887 -
888 ((void) (0))-
889 ;-
890 zText = (char *)contextMalloc(context, (2*(i64)nBlob)+4);-
891 if( zText
zTextDescription
TRUEevaluated 123 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-123
892 int i;-
893 for(i=0; i<nBlob
i<nBlobDescription
TRUEevaluated 757 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 123 times by 1 test
Evaluated by:
  • Self test (438)
; i++){
123-757
894 zText[(i*2)+2] = hexdigits[(zBlob[i]>>4)&0x0F];-
895 zText[(i*2)+3] = hexdigits[(zBlob[i])&0x0F];-
896 }
executed 757 times by 1 test: end of block
Executed by:
  • Self test (438)
757
897 zText[(nBlob*2)+2] = '\'';-
898 zText[(nBlob*2)+3] = '\0';-
899 zText[0] = 'X';-
900 zText[1] = '\'';-
901 sqlite3_result_text(context, zText, -1, ((sqlite3_destructor_type)-1));-
902 sqlite3_free(zText);-
903 }
executed 123 times by 1 test: end of block
Executed by:
  • Self test (438)
123
904 break;
executed 123 times by 1 test: break;
Executed by:
  • Self test (438)
123
905 }-
906 case
executed 36958 times by 2 tests: case 3:
Executed by:
  • Self test (34)
  • Self test (438)
3:
executed 36958 times by 2 tests: case 3:
Executed by:
  • Self test (34)
  • Self test (438)
{
36958
907 int i,j;-
908 u64 n;-
909 const unsigned char *zArg = sqlite3_value_text(argv[0]);-
910 char *z;-
911-
912 if( zArg==0
zArg==0Description
TRUEnever evaluated
FALSEevaluated 36958 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
) return;
never executed: return;
0-36958
913 for(i=0, n=0; zArg[i]
zArg[i]Description
TRUEevaluated 115356 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 36958 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
; i++){ if( zArg[i]=='\''
zArg[i]=='\''Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 115355 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
) n++;
executed 1 time by 1 test: n++;
Executed by:
  • Self test (438)
}
executed 115356 times by 2 tests: end of block
Executed by:
  • Self test (34)
  • Self test (438)
1-115356
914 z = contextMalloc(context, ((i64)i)+((i64)n)+3);-
915 if( z
zDescription
TRUEevaluated 36958 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEnever evaluated
){
0-36958
916 z[0] = '\'';-
917 for(i=0, j=1; zArg[i]
zArg[i]Description
TRUEevaluated 115356 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
FALSEevaluated 36958 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
; i++){
36958-115356
918 z[j++] = zArg[i];-
919 if( zArg[i]=='\''
zArg[i]=='\''Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 115355 times by 2 tests
Evaluated by:
  • Self test (34)
  • Self test (438)
){
1-115355
920 z[j++] = '\'';-
921 }
executed 1 time by 1 test: end of block
Executed by:
  • Self test (438)
1
922 }
executed 115356 times by 2 tests: end of block
Executed by:
  • Self test (34)
  • Self test (438)
115356
923 z[j++] = '\'';-
924 z[j] = 0;-
925 sqlite3_result_text(context, z, j, sqlite3_free);-
926 }
executed 36958 times by 2 tests: end of block
Executed by:
  • Self test (34)
  • Self test (438)
36958
927 break;
executed 36958 times by 2 tests: break;
Executed by:
  • Self test (34)
  • Self test (438)
36958
928 }-
929 default
executed 25 times by 1 test: default:
Executed by:
  • Self test (438)
:
executed 25 times by 1 test: default:
Executed by:
  • Self test (438)
{
25
930 -
931 ((void) (0))-
932 ;-
933 sqlite3_result_text(context, "NULL", 4, ((sqlite3_destructor_type)0));-
934 break;
executed 25 times by 1 test: break;
Executed by:
  • Self test (438)
25
935 }-
936 }-
937}-
938-
939-
940-
941-
942-
943static void unicodeFunc(-
944 sqlite3_context *context,-
945 int argc,-
946 sqlite3_value **argv-
947){-
948 const unsigned char *z = sqlite3_value_text(argv[0]);-
949 (void)argc;-
950 if( z
zDescription
TRUEevaluated 12283 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
&& z[0]
z[0]Description
TRUEevaluated 12283 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
) sqlite3_result_int(context, sqlite3Utf8Read(&z));
executed 12283 times by 1 test: sqlite3_result_int(context, sqlite3Utf8Read(&z));
Executed by:
  • Self test (438)
0-12283
951}
executed 12283 times by 1 test: end of block
Executed by:
  • Self test (438)
12283
952-
953-
954-
955-
956-
957-
958static void charFunc(-
959 sqlite3_context *context,-
960 int argc,-
961 sqlite3_value **argv-
962){-
963 unsigned char *z, *zOut;-
964 int i;-
965 zOut = z = sqlite3_malloc64( argc*4+1 );-
966 if( z==0
z==0Description
TRUEnever evaluated
FALSEevaluated 12345 times by 1 test
Evaluated by:
  • Self test (438)
){
0-12345
967 sqlite3_result_error_nomem(context);-
968 return;
never executed: return;
0
969 }-
970 for(i=0; i<argc
i<argcDescription
TRUEevaluated 12344 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 12345 times by 1 test
Evaluated by:
  • Self test (438)
; i++){
12344-12345
971 sqlite3_int64 x;-
972 unsigned c;-
973 x = sqlite3_value_int64(argv[i]);-
974 if( x<0
x<0Description
TRUEnever evaluated
FALSEevaluated 12344 times by 1 test
Evaluated by:
  • Self test (438)
|| x>0x10ffff
x>0x10ffffDescription
TRUEnever evaluated
FALSEevaluated 12344 times by 1 test
Evaluated by:
  • Self test (438)
) x = 0xfffd;
never executed: x = 0xfffd;
0-12344
975 c = (unsigned)(x & 0x1fffff);-
976 if( c<0x00080
c<0x00080Description
TRUEevaluated 37 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 12307 times by 1 test
Evaluated by:
  • Self test (438)
){
37-12307
977 *zOut++ = (u8)(c&0xFF);-
978 }
executed 37 times by 1 test: end of block
Executed by:
  • Self test (438)
else if( c<0x00800
c<0x00800Description
TRUEevaluated 155 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 12152 times by 1 test
Evaluated by:
  • Self test (438)
){
37-12152
979 *zOut++ = 0xC0 + (u8)((c>>6)&0x1F);-
980 *zOut++ = 0x80 + (u8)(c & 0x3F);-
981 }
executed 155 times by 1 test: end of block
Executed by:
  • Self test (438)
else if( c<0x10000
c<0x10000Description
TRUEevaluated 4585 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 7567 times by 1 test
Evaluated by:
  • Self test (438)
){
155-7567
982 *zOut++ = 0xE0 + (u8)((c>>12)&0x0F);-
983 *zOut++ = 0x80 + (u8)((c>>6) & 0x3F);-
984 *zOut++ = 0x80 + (u8)(c & 0x3F);-
985 }
executed 4585 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
4585
986 *zOut++ = 0xF0 + (u8)((c>>18) & 0x07);-
987 *zOut++ = 0x80 + (u8)((c>>12) & 0x3F);-
988 *zOut++ = 0x80 + (u8)((c>>6) & 0x3F);-
989 *zOut++ = 0x80 + (u8)(c & 0x3F);-
990 }
executed 7567 times by 1 test: end of block
Executed by:
  • Self test (438)
7567
991 }-
992 sqlite3_result_text64(context, (char*)z, zOut-z, sqlite3_free, 1);-
993}
executed 12345 times by 1 test: end of block
Executed by:
  • Self test (438)
12345
994-
995-
996-
997-
998-
999static void hexFunc(-
1000 sqlite3_context *context,-
1001 int argc,-
1002 sqlite3_value **argv-
1003){-
1004 int i, n;-
1005 const unsigned char *pBlob;-
1006 char *zHex, *z;-
1007 -
1008 ((void) (0))-
1009 ;-
1010 (void)(argc);-
1011 pBlob = sqlite3_value_blob(argv[0]);-
1012 n = sqlite3_value_bytes(argv[0]);-
1013 -
1014 ((void) (0))-
1015 ;-
1016 z = zHex = contextMalloc(context, ((i64)n)*2 + 1);-
1017 if( zHex
zHexDescription
TRUEevaluated 959 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-959
1018 for(i=0; i<n
i<nDescription
TRUEevaluated 99236 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 959 times by 1 test
Evaluated by:
  • Self test (438)
; i++, pBlob++){
959-99236
1019 unsigned char c = *pBlob;-
1020 *(z++) = hexdigits[(c>>4)&0xf];-
1021 *(z++) = hexdigits[c&0xf];-
1022 }
executed 99236 times by 1 test: end of block
Executed by:
  • Self test (438)
99236
1023 *z = 0;-
1024 sqlite3_result_text(context, zHex, n*2, sqlite3_free);-
1025 }
executed 959 times by 1 test: end of block
Executed by:
  • Self test (438)
959
1026}
executed 959 times by 1 test: end of block
Executed by:
  • Self test (438)
959
1027-
1028-
1029-
1030-
1031static void zeroblobFunc(-
1032 sqlite3_context *context,-
1033 int argc,-
1034 sqlite3_value **argv-
1035){-
1036 i64 n;-
1037 int rc;-
1038 -
1039 ((void) (0))-
1040 ;-
1041 (void)(argc);-
1042 n = sqlite3_value_int64(argv[0]);-
1043 if( n<0
n<0Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 867 times by 1 test
Evaluated by:
  • Self test (438)
) n = 0;
executed 9 times by 1 test: n = 0;
Executed by:
  • Self test (438)
9-867
1044 rc = sqlite3_result_zeroblob64(context, n);-
1045 if( rc
rcDescription
TRUEevaluated 5 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 871 times by 1 test
Evaluated by:
  • Self test (438)
){
5-871
1046 sqlite3_result_error_code(context, rc);-
1047 }
executed 5 times by 1 test: end of block
Executed by:
  • Self test (438)
5
1048}
executed 876 times by 1 test: end of block
Executed by:
  • Self test (438)
876
1049-
1050-
1051-
1052-
1053-
1054-
1055-
1056static void replaceFunc(-
1057 sqlite3_context *context,-
1058 int argc,-
1059 sqlite3_value **argv-
1060){-
1061 const unsigned char *zStr;-
1062 const unsigned char *zPattern;-
1063 const unsigned char *zRep;-
1064 unsigned char *zOut;-
1065 int nStr;-
1066 int nPattern;-
1067 int nRep;-
1068 i64 nOut;-
1069 int loopLimit;-
1070 int i, j;-
1071 unsigned cntExpand;-
1072 sqlite3 *db = sqlite3_context_db_handle(context);-
1073-
1074 -
1075 ((void) (0))-
1076 ;-
1077 (void)(argc);-
1078 zStr = sqlite3_value_text(argv[0]);-
1079 if( zStr==0
zStr==0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1085 times by 1 test
Evaluated by:
  • Self test (438)
) return;
executed 1 time by 1 test: return;
Executed by:
  • Self test (438)
1-1085
1080 nStr = sqlite3_value_bytes(argv[0]);-
1081 -
1082 ((void) (0))-
1083 ;-
1084 zPattern = sqlite3_value_text(argv[1]);-
1085 if( zPattern==0
zPattern==0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1084 times by 1 test
Evaluated by:
  • Self test (438)
){
1-1084
1086 -
1087 ((void) (0))-
1088 -
1089 ;-
1090 return;
executed 1 time by 1 test: return;
Executed by:
  • Self test (438)
1
1091 }-
1092 if( zPattern[0]==0
zPattern[0]==0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1083 times by 1 test
Evaluated by:
  • Self test (438)
){
1-1083
1093 -
1094 ((void) (0))-
1095 ;-
1096 sqlite3_result_value(context, argv[0]);-
1097 return;
executed 1 time by 1 test: return;
Executed by:
  • Self test (438)
1
1098 }-
1099 nPattern = sqlite3_value_bytes(argv[1]);-
1100 -
1101 ((void) (0))-
1102 ;-
1103 zRep = sqlite3_value_text(argv[2]);-
1104 if( zRep==0
zRep==0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1082 times by 1 test
Evaluated by:
  • Self test (438)
) return;
executed 1 time by 1 test: return;
Executed by:
  • Self test (438)
1-1082
1105 nRep = sqlite3_value_bytes(argv[2]);-
1106 -
1107 ((void) (0))-
1108 ;-
1109 nOut = nStr + 1;-
1110 -
1111 ((void) (0))-
1112 ;-
1113 zOut = contextMalloc(context, (i64)nOut);-
1114 if( zOut==0
zOut==0Description
TRUEnever evaluated
FALSEevaluated 1082 times by 1 test
Evaluated by:
  • Self test (438)
){
0-1082
1115 return;
never executed: return;
0
1116 }-
1117 loopLimit = nStr - nPattern;-
1118 cntExpand = 0;-
1119 for(i=j=0; i<=loopLimit
i<=loopLimitDescription
TRUEevaluated 613296 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1082 times by 1 test
Evaluated by:
  • Self test (438)
; i++){
1082-613296
1120 if( zStr[i]!=zPattern[0]
zStr[i]!=zPattern[0]Description
TRUEevaluated 71925 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 541371 times by 1 test
Evaluated by:
  • Self test (438)
|| memcmp(&zStr[i], zPattern, nPattern)
memcmp(&zStr[i...ern, nPattern)Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 541370 times by 1 test
Evaluated by:
  • Self test (438)
){
1-541371
1121 zOut[j++] = zStr[i];-
1122 }
executed 71926 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
71926
1123 if( nRep>nPattern
nRep>nPatternDescription
TRUEevaluated 541333 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 37 times by 1 test
Evaluated by:
  • Self test (438)
){
37-541333
1124 nOut += nRep - nPattern;-
1125 ;-
1126 ;-
1127 if( nOut-1>db->aLimit[0]
nOut-1>db->aLimit[0]Description
TRUEnever evaluated
FALSEevaluated 541333 times by 1 test
Evaluated by:
  • Self test (438)
){
0-541333
1128 sqlite3_result_error_toobig(context);-
1129 sqlite3_free(zOut);-
1130 return;
never executed: return;
0
1131 }-
1132 cntExpand++;-
1133 if( (
(cntExpand&(cntExpand-1))==0Description
TRUEevaluated 9413 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 531920 times by 1 test
Evaluated by:
  • Self test (438)
cntExpand&(cntExpand-1))==0
(cntExpand&(cntExpand-1))==0Description
TRUEevaluated 9413 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 531920 times by 1 test
Evaluated by:
  • Self test (438)
){
9413-531920
1134-
1135-
1136 u8 *zOld;-
1137 zOld = zOut;-
1138 zOut = sqlite3_realloc64(zOut, (int)nOut + (nOut - nStr - 1));-
1139 if( zOut==0
zOut==0Description
TRUEnever evaluated
FALSEevaluated 9413 times by 1 test
Evaluated by:
  • Self test (438)
){
0-9413
1140 sqlite3_result_error_nomem(context);-
1141 sqlite3_free(zOld);-
1142 return;
never executed: return;
0
1143 }-
1144 }
executed 9413 times by 1 test: end of block
Executed by:
  • Self test (438)
9413
1145 }
executed 541333 times by 1 test: end of block
Executed by:
  • Self test (438)
541333
1146 memcpy(&zOut[j], zRep, nRep);-
1147 j += nRep;-
1148 i += nPattern-1;-
1149 }
executed 541370 times by 1 test: end of block
Executed by:
  • Self test (438)
541370
1150 }-
1151 -
1152 ((void) (0))-
1153 ;-
1154 memcpy(&zOut[j], &zStr[i], nStr-i);-
1155 j += nStr - i;-
1156 -
1157 ((void) (0))-
1158 ;-
1159 zOut[j] = 0;-
1160 sqlite3_result_text(context, (char*)zOut, j, sqlite3_free);-
1161}
executed 1082 times by 1 test: end of block
Executed by:
  • Self test (438)
1082
1162-
1163-
1164-
1165-
1166-
1167static void trimFunc(-
1168 sqlite3_context *context,-
1169 int argc,-
1170 sqlite3_value **argv-
1171){-
1172 const unsigned char *zIn;-
1173 const unsigned char *zCharSet;-
1174 int nIn;-
1175 int flags;-
1176 int i;-
1177 unsigned char *aLen = 0;-
1178 unsigned char **azChar = 0;-
1179 int nChar;-
1180-
1181 if( sqlite3_value_type(argv[0])==5
sqlite3_value_type(argv[0])==5Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 49 times by 1 test
Evaluated by:
  • Self test (438)
){
2-49
1182 return;
executed 2 times by 1 test: return;
Executed by:
  • Self test (438)
2
1183 }-
1184 zIn = sqlite3_value_text(argv[0]);-
1185 if( zIn==0
zIn==0Description
TRUEnever evaluated
FALSEevaluated 49 times by 1 test
Evaluated by:
  • Self test (438)
) return;
never executed: return;
0-49
1186 nIn = sqlite3_value_bytes(argv[0]);-
1187 -
1188 ((void) (0))-
1189 ;-
1190 if( argc==1
argc==1Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 23 times by 1 test
Evaluated by:
  • Self test (438)
){
23-26
1191 static const unsigned char lenOne[] = { 1 };-
1192 static unsigned char * const azOne[] = { (u8*)" " };-
1193 nChar = 1;-
1194 aLen = (u8*)lenOne;-
1195 azChar = (unsigned char **)azOne;-
1196 zCharSet = 0;-
1197 }
executed 26 times by 1 test: end of block
Executed by:
  • Self test (438)
else if( (
(zCharSet = sq...t(argv[1]))==0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 22 times by 1 test
Evaluated by:
  • Self test (438)
zCharSet = sqlite3_value_text(argv[1]))==0
(zCharSet = sq...t(argv[1]))==0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 22 times by 1 test
Evaluated by:
  • Self test (438)
){
1-26
1198 return;
executed 1 time by 1 test: return;
Executed by:
  • Self test (438)
1
1199 }else{-
1200 const unsigned char *z;-
1201 for(z=zCharSet, nChar=0; *
*zDescription
TRUEevaluated 43 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 22 times by 1 test
Evaluated by:
  • Self test (438)
z
*zDescription
TRUEevaluated 43 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 22 times by 1 test
Evaluated by:
  • Self test (438)
; nChar++){
22-43
1202 { if( (*(
(*(z++))>=0xc0Description
TRUEevaluated 13 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 30 times by 1 test
Evaluated by:
  • Self test (438)
z++))>=0xc0
(*(z++))>=0xc0Description
TRUEevaluated 13 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 30 times by 1 test
Evaluated by:
  • Self test (438)
){ while( (*
(*z & 0xc0)==0x80Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 13 times by 1 test
Evaluated by:
  • Self test (438)
z & 0xc0)==0x80
(*z & 0xc0)==0x80Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 13 times by 1 test
Evaluated by:
  • Self test (438)
){ z++; }
executed 15 times by 1 test: end of block
Executed by:
  • Self test (438)
}
executed 13 times by 1 test: end of block
Executed by:
  • Self test (438)
};
13-30
1203 }
executed 43 times by 1 test: end of block
Executed by:
  • Self test (438)
43
1204 if( nChar>0
nChar>0Description
TRUEevaluated 21 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
){
1-21
1205 azChar = contextMalloc(context, ((i64)nChar)*(sizeof(char*)+1));-
1206 if( azChar==0
azChar==0Description
TRUEnever evaluated
FALSEevaluated 21 times by 1 test
Evaluated by:
  • Self test (438)
){
0-21
1207 return;
never executed: return;
0
1208 }-
1209 aLen = (unsigned char*)&azChar[nChar];-
1210 for(z=zCharSet, nChar=0; *
*zDescription
TRUEevaluated 43 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 21 times by 1 test
Evaluated by:
  • Self test (438)
z
*zDescription
TRUEevaluated 43 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 21 times by 1 test
Evaluated by:
  • Self test (438)
; nChar++){
21-43
1211 azChar[nChar] = (unsigned char *)z;-
1212 { if( (*(
(*(z++))>=0xc0Description
TRUEevaluated 13 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 30 times by 1 test
Evaluated by:
  • Self test (438)
z++))>=0xc0
(*(z++))>=0xc0Description
TRUEevaluated 13 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 30 times by 1 test
Evaluated by:
  • Self test (438)
){ while( (*
(*z & 0xc0)==0x80Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 13 times by 1 test
Evaluated by:
  • Self test (438)
z & 0xc0)==0x80
(*z & 0xc0)==0x80Description
TRUEevaluated 15 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 13 times by 1 test
Evaluated by:
  • Self test (438)
){ z++; }
executed 15 times by 1 test: end of block
Executed by:
  • Self test (438)
}
executed 13 times by 1 test: end of block
Executed by:
  • Self test (438)
};
13-30
1213 aLen[nChar] = (u8)(z - azChar[nChar]);-
1214 }
executed 43 times by 1 test: end of block
Executed by:
  • Self test (438)
43
1215 }
executed 21 times by 1 test: end of block
Executed by:
  • Self test (438)
21
1216 }
executed 22 times by 1 test: end of block
Executed by:
  • Self test (438)
22
1217 if( nChar>0
nChar>0Description
TRUEevaluated 47 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
){
1-47
1218 flags = ((int)(long int)(sqlite3_user_data(context)));-
1219 if( flags & 1
flags & 1Description
TRUEevaluated 21 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 26 times by 1 test
Evaluated by:
  • Self test (438)
){
21-26
1220 while( nIn>0
nIn>0Description
TRUEevaluated 51 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-51
1221 int len = 0;-
1222 for(i=0; i<nChar
i<nCharDescription
TRUEevaluated 81 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 21 times by 1 test
Evaluated by:
  • Self test (438)
; i++){
21-81
1223 len = aLen[i];-
1224 if( len<=nIn
len<=nInDescription
TRUEevaluated 81 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
&& memcmp(zIn, azChar[i], len)==0
memcmp(zIn, azChar[i], len)==0Description
TRUEevaluated 30 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 51 times by 1 test
Evaluated by:
  • Self test (438)
) break;
executed 30 times by 1 test: break;
Executed by:
  • Self test (438)
0-81
1225 }
executed 51 times by 1 test: end of block
Executed by:
  • Self test (438)
51
1226 if( i>=nChar
i>=nCharDescription
TRUEevaluated 21 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 30 times by 1 test
Evaluated by:
  • Self test (438)
) break;
executed 21 times by 1 test: break;
Executed by:
  • Self test (438)
21-30
1227 zIn += len;-
1228 nIn -= len;-
1229 }
executed 30 times by 1 test: end of block
Executed by:
  • Self test (438)
30
1230 }
executed 21 times by 1 test: end of block
Executed by:
  • Self test (438)
21
1231 if( flags & 2
flags & 2Description
TRUEevaluated 42 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 5 times by 1 test
Evaluated by:
  • Self test (438)
){
5-42
1232 while( nIn>0
nIn>0Description
TRUEevaluated 471 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-471
1233 int len = 0;-
1234 for(i=0; i<nChar
i<nCharDescription
TRUEevaluated 513 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 42 times by 1 test
Evaluated by:
  • Self test (438)
; i++){
42-513
1235 len = aLen[i];-
1236 if( len<=nIn
len<=nInDescription
TRUEevaluated 511 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
&& memcmp(&zIn[nIn-len],azChar[i],len)==0
memcmp(&zIn[nI...har[i],len)==0Description
TRUEevaluated 429 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 82 times by 1 test
Evaluated by:
  • Self test (438)
) break;
executed 429 times by 1 test: break;
Executed by:
  • Self test (438)
2-511
1237 }
executed 84 times by 1 test: end of block
Executed by:
  • Self test (438)
84
1238 if( i>=nChar
i>=nCharDescription
TRUEevaluated 42 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 429 times by 1 test
Evaluated by:
  • Self test (438)
) break;
executed 42 times by 1 test: break;
Executed by:
  • Self test (438)
42-429
1239 nIn -= len;-
1240 }
executed 429 times by 1 test: end of block
Executed by:
  • Self test (438)
429
1241 }
executed 42 times by 1 test: end of block
Executed by:
  • Self test (438)
42
1242 if( zCharSet
zCharSetDescription
TRUEevaluated 21 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 26 times by 1 test
Evaluated by:
  • Self test (438)
){
21-26
1243 sqlite3_free(azChar);-
1244 }
executed 21 times by 1 test: end of block
Executed by:
  • Self test (438)
21
1245 }
executed 47 times by 1 test: end of block
Executed by:
  • Self test (438)
47
1246 sqlite3_result_text(context, (char*)zIn, nIn, ((sqlite3_destructor_type)-1));-
1247}
executed 48 times by 1 test: end of block
Executed by:
  • Self test (438)
48
1248static void loadExt(sqlite3_context *context, int argc, sqlite3_value **argv){-
1249 const char *zFile = (const char *)sqlite3_value_text(argv[0]);-
1250 const char *zProc;-
1251 sqlite3 *db = sqlite3_context_db_handle(context);-
1252 char *zErrMsg = 0;-
1253-
1254-
1255-
1256-
1257 if( (
(db->flags & 0x00020000)==0Description
TRUEnever evaluated
FALSEnever evaluated
db->flags & 0x00020000)==0
(db->flags & 0x00020000)==0Description
TRUEnever evaluated
FALSEnever evaluated
){
0
1258 sqlite3_result_error(context, "not authorized", -1);-
1259 return;
never executed: return;
0
1260 }-
1261-
1262 if( argc==2
argc==2Description
TRUEnever evaluated
FALSEnever evaluated
){
0
1263 zProc = (const char *)sqlite3_value_text(argv[1]);-
1264 }
never executed: end of block
else{
0
1265 zProc = 0;-
1266 }
never executed: end of block
0
1267 if( zFile
zFileDescription
TRUEnever evaluated
FALSEnever evaluated
&& sqlite3_load_extension(db, zFile, zProc, &zErrMsg)
sqlite3_load_e...roc, &zErrMsg)Description
TRUEnever evaluated
FALSEnever evaluated
){
0
1268 sqlite3_result_error(context, zErrMsg, -1);-
1269 sqlite3_free(zErrMsg);-
1270 }
never executed: end of block
0
1271}
never executed: end of block
0
1272-
1273-
1274-
1275-
1276-
1277-
1278-
1279typedef struct SumCtx SumCtx;-
1280struct SumCtx {-
1281 double rSum;-
1282 i64 iSum;-
1283 i64 cnt;-
1284 u8 overflow;-
1285 u8 approx;-
1286};-
1287static void sumStep(sqlite3_context *context, int argc, sqlite3_value **argv){-
1288 SumCtx *p;-
1289 int type;-
1290 -
1291 ((void) (0))-
1292 ;-
1293 (void)(argc);-
1294 p = sqlite3_aggregate_context(context, sizeof(*p));-
1295 type = sqlite3_value_numeric_type(argv[0]);-
1296 if( p
pDescription
TRUEevaluated 250700 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
&& type!=5
type!=5Description
TRUEevaluated 250499 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 201 times by 1 test
Evaluated by:
  • Self test (438)
){
0-250700
1297 p->cnt++;-
1298 if( type==1
type==1Description
TRUEevaluated 250444 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 55 times by 1 test
Evaluated by:
  • Self test (438)
){
55-250444
1299 i64 v = sqlite3_value_int64(argv[0]);-
1300 p->rSum += v;-
1301 if( (
(p->approx|p->overflow)==0Description
TRUEevaluated 250436 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test (438)
p->approx|p->overflow)==0
(p->approx|p->overflow)==0Description
TRUEevaluated 250436 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 8 times by 1 test
Evaluated by:
  • Self test (438)
&& sqlite3AddInt64(&p->iSum, v)
sqlite3AddInt64(&p->iSum, v)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 250432 times by 1 test
Evaluated by:
  • Self test (438)
){
4-250436
1302 p->approx = p->overflow = 1;-
1303 }
executed 4 times by 1 test: end of block
Executed by:
  • Self test (438)
4
1304 }
executed 250444 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
250444
1305 p->rSum += sqlite3_value_double(argv[0]);-
1306 p->approx = 1;-
1307 }
executed 55 times by 1 test: end of block
Executed by:
  • Self test (438)
55
1308 }-
1309}
executed 250700 times by 1 test: end of block
Executed by:
  • Self test (438)
250700
1310-
1311static void sumInverse(sqlite3_context *context, int argc, sqlite3_value**argv){-
1312 SumCtx *p;-
1313 int type;-
1314 -
1315 ((void) (0))-
1316 ;-
1317 (void)(argc);-
1318 p = sqlite3_aggregate_context(context, sizeof(*p));-
1319 type = sqlite3_value_numeric_type(argv[0]);-
1320-
1321-
1322 if( (
(p)Description
TRUEevaluated 1878 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
p)
(p)Description
TRUEevaluated 1878 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
&& type!=5
type!=5Description
TRUEevaluated 1878 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-1878
1323 -
1324 ((void) (0))-
1325 ;-
1326 p->cnt--;-
1327 -
1328 ((void) (0))-
1329 ;-
1330 if( type==1
type==1Description
TRUEevaluated 1874 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 4 times by 1 test
Evaluated by:
  • Self test (438)
&& p->approx==0
p->approx==0Description
TRUEevaluated 1874 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-1874
1331 i64 v = sqlite3_value_int64(argv[0]);-
1332 p->rSum -= v;-
1333 p->iSum -= v;-
1334 }
executed 1874 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
1874
1335 p->rSum -= sqlite3_value_double(argv[0]);-
1336 }
executed 4 times by 1 test: end of block
Executed by:
  • Self test (438)
4
1337 }-
1338}
executed 1878 times by 1 test: end of block
Executed by:
  • Self test (438)
1878
1339-
1340-
1341-
1342static void sumFinalize(sqlite3_context *context){-
1343 SumCtx *p;-
1344 p = sqlite3_aggregate_context(context, 0);-
1345 if( p
pDescription
TRUEevaluated 6330 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 328 times by 1 test
Evaluated by:
  • Self test (438)
&& p->cnt>0
p->cnt>0Description
TRUEevaluated 6253 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 77 times by 1 test
Evaluated by:
  • Self test (438)
){
77-6330
1346 if( p->overflow
p->overflowDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 6250 times by 1 test
Evaluated by:
  • Self test (438)
){
3-6250
1347 sqlite3_result_error(context,"integer overflow",-1);-
1348 }
executed 3 times by 1 test: end of block
Executed by:
  • Self test (438)
else if( p->approx
p->approxDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 6222 times by 1 test
Evaluated by:
  • Self test (438)
){
3-6222
1349 sqlite3_result_double(context, p->rSum);-
1350 }
executed 28 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
28
1351 sqlite3_result_int64(context, p->iSum);-
1352 }
executed 6222 times by 1 test: end of block
Executed by:
  • Self test (438)
6222
1353 }-
1354}
executed 6658 times by 1 test: end of block
Executed by:
  • Self test (438)
6658
1355static void avgFinalize(sqlite3_context *context){-
1356 SumCtx *p;-
1357 p = sqlite3_aggregate_context(context, 0);-
1358 if( p
pDescription
TRUEevaluated 2145 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
&& p->cnt>0
p->cnt>0Description
TRUEevaluated 2145 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-2145
1359 sqlite3_result_double(context, p->rSum/(double)p->cnt);-
1360 }
executed 2145 times by 1 test: end of block
Executed by:
  • Self test (438)
2145
1361}
executed 2147 times by 1 test: end of block
Executed by:
  • Self test (438)
2147
1362static void totalFinalize(sqlite3_context *context){-
1363 SumCtx *p;-
1364 p = sqlite3_aggregate_context(context, 0);-
1365-
1366 sqlite3_result_double(context, p ? p->rSum : (double)0);-
1367}
executed 6 times by 1 test: end of block
Executed by:
  • Self test (438)
6
1368-
1369-
1370-
1371-
1372-
1373typedef struct CountCtx CountCtx;-
1374struct CountCtx {-
1375 i64 n;-
1376-
1377-
1378-
1379};-
1380-
1381-
1382-
1383-
1384static void countStep(sqlite3_context *context, int argc, sqlite3_value **argv){-
1385 CountCtx *p;-
1386 p = sqlite3_aggregate_context(context, sizeof(*p));-
1387 if( (argc==0
argc==0Description
TRUEevaluated 1104853 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 404136 times by 1 test
Evaluated by:
  • Self test (438)
|| 5!=sqlite3_value_type(argv[0])
5!=sqlite3_value_type(argv[0])Description
TRUEevaluated 400828 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 3308 times by 1 test
Evaluated by:
  • Self test (438)
) && p
pDescription
TRUEevaluated 1505681 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-1505681
1388 p->n++;-
1389 }
executed 1505681 times by 1 test: end of block
Executed by:
  • Self test (438)
1505681
1390-
1391-
1392-
1393-
1394-
1395-
1396 -
1397 ((void) (0))-
1398 -
1399 ;-
1400-
1401}
executed 1508989 times by 1 test: end of block
Executed by:
  • Self test (438)
1508989
1402static void countFinalize(sqlite3_context *context){-
1403 CountCtx *p;-
1404 p = sqlite3_aggregate_context(context, 0);-
1405 sqlite3_result_int64(context, p ? p->n : 0);-
1406}
executed 19736 times by 1 test: end of block
Executed by:
  • Self test (438)
19736
1407-
1408static void countInverse(sqlite3_context *ctx, int argc, sqlite3_value **argv){-
1409 CountCtx *p;-
1410 p = sqlite3_aggregate_context(ctx, sizeof(*p));-
1411-
1412 if( (argc==0
argc==0Description
TRUEevaluated 7515 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
|| 5!=sqlite3_value_type(argv[0])
5!=sqlite3_value_type(argv[0])Description
TRUEnever evaluated
FALSEnever evaluated
) && (
(p)Description
TRUEevaluated 7515 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
p)
(p)Description
TRUEevaluated 7515 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-7515
1413 p->n--;-
1414-
1415-
1416-
1417 }
executed 7515 times by 1 test: end of block
Executed by:
  • Self test (438)
7515
1418}
executed 7515 times by 1 test: end of block
Executed by:
  • Self test (438)
7515
1419-
1420-
1421-
1422-
1423-
1424-
1425-
1426static void minmaxStep(-
1427 sqlite3_context *context,-
1428 int NotUsed,-
1429 sqlite3_value **argv-
1430){-
1431 Mem *pArg = (Mem *)argv[0];-
1432 Mem *pBest;-
1433 (void)(NotUsed);-
1434-
1435 pBest = (Mem *)sqlite3_aggregate_context(context, sizeof(*pBest));-
1436 if( !pBest
!pBestDescription
TRUEnever evaluated
FALSEevaluated 263340 times by 1 test
Evaluated by:
  • Self test (438)
) return;
never executed: return;
0-263340
1437-
1438 if( sqlite3_value_type(pArg)==5
sqlite3_value_type(pArg)==5Description
TRUEevaluated 4163 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 259177 times by 1 test
Evaluated by:
  • Self test (438)
){
4163-259177
1439 if( pBest->flags
pBest->flagsDescription
TRUEevaluated 35 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 4128 times by 1 test
Evaluated by:
  • Self test (438)
) sqlite3SkipAccumulatorLoad(context);
executed 35 times by 1 test: sqlite3SkipAccumulatorLoad(context);
Executed by:
  • Self test (438)
35-4128
1440 }
executed 4163 times by 1 test: end of block
Executed by:
  • Self test (438)
else if( pBest->flags
pBest->flagsDescription
TRUEevaluated 239068 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 20109 times by 1 test
Evaluated by:
  • Self test (438)
){
4163-239068
1441 int max;-
1442 int cmp;-
1443 CollSeq *pColl = sqlite3GetFuncCollSeq(context);-
1444 max = sqlite3_user_data(context)!=0;-
1445 cmp = sqlite3MemCompare(pBest, pArg, pColl);-
1446 if( (max
maxDescription
TRUEevaluated 195255 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 43813 times by 1 test
Evaluated by:
  • Self test (438)
&& cmp<0
cmp<0Description
TRUEevaluated 162246 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 33009 times by 1 test
Evaluated by:
  • Self test (438)
) || (!max
!maxDescription
TRUEevaluated 43813 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 33009 times by 1 test
Evaluated by:
  • Self test (438)
&& cmp>0
cmp>0Description
TRUEevaluated 7551 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 36262 times by 1 test
Evaluated by:
  • Self test (438)
) ){
7551-195255
1447 sqlite3VdbeMemCopy(pBest, pArg);-
1448 }
executed 169797 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
169797
1449 sqlite3SkipAccumulatorLoad(context);-
1450 }
executed 69271 times by 1 test: end of block
Executed by:
  • Self test (438)
69271
1451 }else{-
1452 pBest->db = sqlite3_context_db_handle(context);-
1453 sqlite3VdbeMemCopy(pBest, pArg);-
1454 }
executed 20109 times by 1 test: end of block
Executed by:
  • Self test (438)
20109
1455}-
1456static void minMaxValueFinalize(sqlite3_context *context, int bValue){-
1457 sqlite3_value *pRes;-
1458 pRes = (sqlite3_value *)sqlite3_aggregate_context(context, 0);-
1459 if( pRes
pResDescription
TRUEevaluated 22713 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 1137 times by 1 test
Evaluated by:
  • Self test (438)
){
1137-22713
1460 if( pRes->flags
pRes->flagsDescription
TRUEevaluated 22694 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 19 times by 1 test
Evaluated by:
  • Self test (438)
){
19-22694
1461 sqlite3_result_value(context, pRes);-
1462 }
executed 22694 times by 1 test: end of block
Executed by:
  • Self test (438)
22694
1463 if( bValue==0
bValue==0Description
TRUEevaluated 20127 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 2586 times by 1 test
Evaluated by:
  • Self test (438)
) sqlite3VdbeMemRelease(pRes);
executed 20127 times by 1 test: sqlite3VdbeMemRelease(pRes);
Executed by:
  • Self test (438)
2586-20127
1464 }
executed 22713 times by 1 test: end of block
Executed by:
  • Self test (438)
22713
1465}
executed 23850 times by 1 test: end of block
Executed by:
  • Self test (438)
23850
1466-
1467static void minMaxValue(sqlite3_context *context){-
1468 minMaxValueFinalize(context, 1);-
1469}
executed 2624 times by 1 test: end of block
Executed by:
  • Self test (438)
2624
1470-
1471-
1472-
1473static void minMaxFinalize(sqlite3_context *context){-
1474 minMaxValueFinalize(context, 0);-
1475}
executed 21226 times by 1 test: end of block
Executed by:
  • Self test (438)
21226
1476-
1477-
1478-
1479-
1480static void groupConcatStep(-
1481 sqlite3_context *context,-
1482 int argc,-
1483 sqlite3_value **argv-
1484){-
1485 const char *zVal;-
1486 StrAccum *pAccum;-
1487 const char *zSep;-
1488 int nVal, nSep;-
1489 -
1490 ((void) (0))-
1491 ;-
1492 if( sqlite3_value_type(argv[0])==5
sqlite3_value_type(argv[0])==5Description
TRUEevaluated 11 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 45192 times by 1 test
Evaluated by:
  • Self test (438)
) return;
executed 11 times by 1 test: return;
Executed by:
  • Self test (438)
11-45192
1493 pAccum = (StrAccum*)sqlite3_aggregate_context(context, sizeof(*pAccum));-
1494-
1495 if( pAccum
pAccumDescription
TRUEevaluated 45192 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-45192
1496 sqlite3 *db = sqlite3_context_db_handle(context);-
1497 int firstTerm = pAccum->mxAlloc==0;-
1498 pAccum->mxAlloc = db->aLimit[0];-
1499 if( !firstTerm
!firstTermDescription
TRUEevaluated 30654 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 14538 times by 1 test
Evaluated by:
  • Self test (438)
){
14538-30654
1500 if( argc==2
argc==2Description
TRUEevaluated 21980 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 8674 times by 1 test
Evaluated by:
  • Self test (438)
){
8674-21980
1501 zSep = (char*)sqlite3_value_text(argv[1]);-
1502 nSep = sqlite3_value_bytes(argv[1]);-
1503 }
executed 21980 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
21980
1504 zSep = ",";-
1505 nSep = 1;-
1506 }
executed 8674 times by 1 test: end of block
Executed by:
  • Self test (438)
8674
1507 if( zSep
zSepDescription
TRUEevaluated 30650 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 4 times by 1 test
Evaluated by:
  • Self test (438)
) sqlite3_str_append(pAccum, zSep, nSep);
executed 30650 times by 1 test: sqlite3_str_append(pAccum, zSep, nSep);
Executed by:
  • Self test (438)
4-30650
1508 }
executed 30654 times by 1 test: end of block
Executed by:
  • Self test (438)
30654
1509 zVal = (char*)sqlite3_value_text(argv[0]);-
1510 nVal = sqlite3_value_bytes(argv[0]);-
1511 if( zVal
zValDescription
TRUEevaluated 45192 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
) sqlite3_str_append(pAccum, zVal, nVal);
executed 45192 times by 1 test: sqlite3_str_append(pAccum, zVal, nVal);
Executed by:
  • Self test (438)
0-45192
1512 }
executed 45192 times by 1 test: end of block
Executed by:
  • Self test (438)
45192
1513}
executed 45192 times by 1 test: end of block
Executed by:
  • Self test (438)
45192
1514-
1515static void groupConcatInverse(-
1516 sqlite3_context *context,-
1517 int argc,-
1518 sqlite3_value **argv-
1519){-
1520 int n;-
1521 StrAccum *pAccum;-
1522 -
1523 ((void) (0))-
1524 ;-
1525 if( sqlite3_value_type(argv[0])==5
sqlite3_value_type(argv[0])==5Description
TRUEnever evaluated
FALSEevaluated 11783 times by 1 test
Evaluated by:
  • Self test (438)
) return;
never executed: return;
0-11783
1526 pAccum = (StrAccum*)sqlite3_aggregate_context(context, sizeof(*pAccum));-
1527-
1528-
1529 if( (
(pAccum)Description
TRUEevaluated 11783 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
pAccum)
(pAccum)Description
TRUEevaluated 11783 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-11783
1530 n = sqlite3_value_bytes(argv[0]);-
1531 if( argc==2
argc==2Description
TRUEevaluated 11781 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 2 times by 1 test
Evaluated by:
  • Self test (438)
){
2-11781
1532 n += sqlite3_value_bytes(argv[1]);-
1533 }
executed 11781 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
11781
1534 n++;-
1535 }
executed 2 times by 1 test: end of block
Executed by:
  • Self test (438)
2
1536 if( n>=(int)pAccum->nChar
n>=(int)pAccum->nCharDescription
TRUEevaluated 1640 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 10143 times by 1 test
Evaluated by:
  • Self test (438)
){
1640-10143
1537 pAccum->nChar = 0;-
1538 }
executed 1640 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
1640
1539 pAccum->nChar -= n;-
1540 memmove(pAccum->zText, &pAccum->zText[n], pAccum->nChar);-
1541 }
executed 10143 times by 1 test: end of block
Executed by:
  • Self test (438)
10143
1542 if( pAccum->nChar==0
pAccum->nChar==0Description
TRUEevaluated 1640 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 10143 times by 1 test
Evaluated by:
  • Self test (438)
) pAccum->mxAlloc = 0;
executed 1640 times by 1 test: pAccum->mxAlloc = 0;
Executed by:
  • Self test (438)
1640-10143
1543 }
executed 11783 times by 1 test: end of block
Executed by:
  • Self test (438)
11783
1544}
executed 11783 times by 1 test: end of block
Executed by:
  • Self test (438)
11783
1545-
1546-
1547-
1548static void groupConcatFinalize(sqlite3_context *context){-
1549 StrAccum *pAccum;-
1550 pAccum = sqlite3_aggregate_context(context, 0);-
1551 if( pAccum
pAccumDescription
TRUEevaluated 13362 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 694 times by 1 test
Evaluated by:
  • Self test (438)
){
694-13362
1552 if( pAccum->accError==18
pAccum->accError==18Description
TRUEnever evaluated
FALSEevaluated 13362 times by 1 test
Evaluated by:
  • Self test (438)
){
0-13362
1553 sqlite3_result_error_toobig(context);-
1554 }
never executed: end of block
else if( pAccum->accError==7
pAccum->accError==7Description
TRUEnever evaluated
FALSEevaluated 13362 times by 1 test
Evaluated by:
  • Self test (438)
){
0-13362
1555 sqlite3_result_error_nomem(context);-
1556 }
never executed: end of block
else{
0
1557 sqlite3_result_text(context, sqlite3StrAccumFinish(pAccum), -1,-
1558 sqlite3_free);-
1559 }
executed 13362 times by 1 test: end of block
Executed by:
  • Self test (438)
13362
1560 }-
1561}
executed 14056 times by 1 test: end of block
Executed by:
  • Self test (438)
14056
1562-
1563static void groupConcatValue(sqlite3_context *context){-
1564 sqlite3_str *pAccum;-
1565 pAccum = (sqlite3_str*)sqlite3_aggregate_context(context, 0);-
1566 if( pAccum
pAccumDescription
TRUEevaluated 21797 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 8129 times by 1 test
Evaluated by:
  • Self test (438)
){
8129-21797
1567 if( pAccum->accError==18
pAccum->accError==18Description
TRUEnever evaluated
FALSEevaluated 21797 times by 1 test
Evaluated by:
  • Self test (438)
){
0-21797
1568 sqlite3_result_error_toobig(context);-
1569 }
never executed: end of block
else if( pAccum->accError==7
pAccum->accError==7Description
TRUEnever evaluated
FALSEevaluated 21797 times by 1 test
Evaluated by:
  • Self test (438)
){
0-21797
1570 sqlite3_result_error_nomem(context);-
1571 }
never executed: end of block
else{
0
1572 const char *zText = sqlite3_str_value(pAccum);-
1573 sqlite3_result_text(context, zText, -1, ((sqlite3_destructor_type)-1));-
1574 }
executed 21797 times by 1 test: end of block
Executed by:
  • Self test (438)
21797
1575 }-
1576}
executed 29926 times by 1 test: end of block
Executed by:
  • Self test (438)
29926
1577void sqlite3RegisterPerConnectionBuiltinFunctions(sqlite3 *db){-
1578 int rc = sqlite3_overload_function(db, "MATCH", 2);-
1579 -
1580 ((void) (0))-
1581 ;-
1582 if( rc==7
rc==7Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 31743 times by 438 tests
Evaluated by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (102)
  • 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)
  • ...
){
32-31743
1583 sqlite3OomFault(db);-
1584 }
executed 32 times by 1 test: end of block
Executed by:
  • Self test (438)
32
1585}
executed 31775 times by 438 tests: end of block
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (102)
  • 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)
  • ...
31775
1586-
1587-
1588-
1589-
1590static void setLikeOptFlag(sqlite3 *db, const char *zName, u8 flagVal){-
1591 FuncDef *pDef;-
1592 pDef = sqlite3FindFunction(db, zName, 2, 1, 0);-
1593 if( (
(pDef)Description
TRUEevaluated 58 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
pDef)
(pDef)Description
TRUEevaluated 58 times by 1 test
Evaluated by:
  • Self test (438)
FALSEnever evaluated
){
0-58
1594 pDef->funcFlags |= flagVal;-
1595 }
executed 58 times by 1 test: end of block
Executed by:
  • Self test (438)
58
1596}
executed 58 times by 1 test: end of block
Executed by:
  • Self test (438)
58
1597-
1598-
1599-
1600-
1601-
1602-
1603void sqlite3RegisterLikeFunctions(sqlite3 *db, int caseSensitive){-
1604 struct compareInfo *pInfo;-
1605 if( caseSensitive
caseSensitiveDescription
TRUEevaluated 14 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 15 times by 1 test
Evaluated by:
  • Self test (438)
){
14-15
1606 pInfo = (struct compareInfo*)&likeInfoAlt;-
1607 }
executed 14 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
14
1608 pInfo = (struct compareInfo*)&likeInfoNorm;-
1609 }
executed 15 times by 1 test: end of block
Executed by:
  • Self test (438)
15
1610 sqlite3CreateFunc(db, "like", 2, 1, pInfo, likeFunc, 0, 0, 0, 0, 0);-
1611 sqlite3CreateFunc(db, "like", 3, 1, pInfo, likeFunc, 0, 0, 0, 0, 0);-
1612 sqlite3CreateFunc(db, "glob", 2, 1,-
1613 (struct compareInfo*)&globInfo, likeFunc, 0, 0, 0, 0, 0);-
1614 setLikeOptFlag(db, "glob", 0x0004 | 0x0008);-
1615 setLikeOptFlag(db, "like",-
1616 caseSensitive ? (0x0004 | 0x0008) : 0x0004);-
1617}
executed 29 times by 1 test: end of block
Executed by:
  • Self test (438)
29
1618int sqlite3IsLikeFunction(sqlite3 *db, Expr *pExpr, int *pIsNocase, char *aWc){-
1619 FuncDef *pDef;-
1620 int nExpr;-
1621 if( pExpr->op!=157
pExpr->op!=157Description
TRUEevaluated 236797 times by 368 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 11590 times by 1 test
Evaluated by:
  • Self test (438)
|| !pExpr->x.pList
!pExpr->x.pListDescription
TRUEnever evaluated
FALSEevaluated 11590 times by 1 test
Evaluated by:
  • Self test (438)
){
0-236797
1622 return
executed 236797 times by 368 tests: return 0;
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)
  • ...
0;
executed 236797 times by 368 tests: return 0;
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)
  • ...
236797
1623 }-
1624 -
1625 ((void) (0))-
1626 ;-
1627 nExpr = pExpr->x.pList->nExpr;-
1628 pDef = sqlite3FindFunction(db, pExpr->u.zToken, nExpr, 1, 0);-
1629 if( (
(pDef==0)Description
TRUEnever evaluated
FALSEevaluated 11590 times by 1 test
Evaluated by:
  • Self test (438)
pDef==0)
(pDef==0)Description
TRUEnever evaluated
FALSEevaluated 11590 times by 1 test
Evaluated by:
  • Self test (438)
|| (
(pDef->funcFlags & 0x0004)==0Description
TRUEevaluated 130 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 11460 times by 1 test
Evaluated by:
  • Self test (438)
pDef->funcFlags & 0x0004)==0
(pDef->funcFlags & 0x0004)==0Description
TRUEevaluated 130 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 11460 times by 1 test
Evaluated by:
  • Self test (438)
){
0-11590
1630 return
executed 130 times by 1 test: return 0;
Executed by:
  • Self test (438)
0;
executed 130 times by 1 test: return 0;
Executed by:
  • Self test (438)
130
1631 }-
1632 if( nExpr<3
nExpr<3Description
TRUEevaluated 11445 times by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 15 times by 1 test
Evaluated by:
  • Self test (438)
){
15-11445
1633 aWc[3] = 0;-
1634 }
executed 11445 times by 1 test: end of block
Executed by:
  • Self test (438)
else{
11445
1635 Expr *pEscape = pExpr->x.pList->a[2].pExpr;-
1636 char *zEscape;-
1637 if( pEscape->op!=106
pEscape->op!=106Description
TRUEnever evaluated
FALSEevaluated 15 times by 1 test
Evaluated by:
  • Self test (438)
) return
never executed: return 0;
0;
never executed: return 0;
0-15
1638 zEscape = pEscape->u.zToken;-
1639 if( zEscape[0]==0
zEscape[0]==0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 14 times by 1 test
Evaluated by:
  • Self test (438)
|| zEscape[1]!=0
zEscape[1]!=0Description
TRUEevaluated 1 time by 1 test
Evaluated by:
  • Self test (438)
FALSEevaluated 13 times by 1 test
Evaluated by:
  • Self test (438)
) return
executed 2 times by 1 test: return 0;
Executed by:
  • Self test (438)
0;
executed 2 times by 1 test: return 0;
Executed by:
  • Self test (438)
1-14
1640 aWc[3] = zEscape[0];-
1641 }
executed 13 times by 1 test: end of block
Executed by:
  • Self test (438)
13
1642-
1643-
1644-
1645-
1646-
1647 memcpy(aWc, pDef->pUserData, 3);-
1648 -
1649 ((void) (0))-
1650 ;-
1651 -
1652 ((void) (0))-
1653 ;-
1654 -
1655 ((void) (0))-
1656 ;-
1657 *pIsNocase = (pDef->funcFlags & 0x0008)==0;-
1658 return
executed 11458 times by 1 test: return 1;
Executed by:
  • Self test (438)
1;
executed 11458 times by 1 test: return 1;
Executed by:
  • Self test (438)
11458
1659}-
1660void sqlite3RegisterBuiltinFunctions(void){-
1661 static FuncDef aBuiltinFunc[] = {-
1662-
1663-
1664-
1665-
1666 {1, 1|(0*0x0020), ((void*)(long int)(0)), 0, loadExt, 0, 0, 0, "load_extension", {0} },-
1667 {2, 1|(0*0x0020), ((void*)(long int)(0)), 0, loadExt, 0, 0, 0, "load_extension", {0} },-
1668-
1669-
1670-
1671-
1672-
1673 {1, 0x2000|1, 0, 0, compileoptionusedFunc, 0, 0, 0, "sqlite_compileoption_used", {0} },-
1674 {1, 0x2000|1, 0, 0, compileoptiongetFunc, 0, 0, 0, "sqlite_compileoption_get", {0} },-
1675-
1676 {1,0x0800|1|(0*0x0020)|0x0400, ((void*)(long int)(0)), 0, versionFunc, 0, 0, 0, "unlikely", {0} },-
1677 {2,0x0800|1|(0*0x0020)|0x0400, ((void*)(long int)(0)), 0, versionFunc, 0, 0, 0, "likelihood", {0} },-
1678 {1,0x0800|1|(0*0x0020)|0x0400, ((void*)(long int)(0)), 0, versionFunc, 0, 0, 0, "likely", {0} },-
1679-
1680-
1681-
1682-
1683-
1684-
1685-
1686 {1, 0x0800|1|(0*0x0020), ((void*)(long int)(1)), 0, trimFunc, 0, 0, 0, "ltrim", {0} },-
1687 {2, 0x0800|1|(0*0x0020), ((void*)(long int)(1)), 0, trimFunc, 0, 0, 0, "ltrim", {0} },-
1688 {1, 0x0800|1|(0*0x0020), ((void*)(long int)(2)), 0, trimFunc, 0, 0, 0, "rtrim", {0} },-
1689 {2, 0x0800|1|(0*0x0020), ((void*)(long int)(2)), 0, trimFunc, 0, 0, 0, "rtrim", {0} },-
1690 {1, 0x0800|1|(0*0x0020), ((void*)(long int)(3)), 0, trimFunc, 0, 0, 0, "trim", {0} },-
1691 {2, 0x0800|1|(0*0x0020), ((void*)(long int)(3)), 0, trimFunc, 0, 0, 0, "trim", {0} },-
1692 {-1, 0x0800|1|(1*0x0020), ((void*)(long int)(0)), 0, minmaxFunc, 0, 0, 0, "min", {0} },-
1693 {0, 0x0800|1|(1*0x0020), ((void*)(long int)(0)), 0, 0, 0, 0, 0, "min", {0} },-
1694 {1, 1|(1*0x0020)|0x1000, ((void*)(long int)(0)), 0, minmaxStep,minMaxFinalize,minMaxValue,0,"min", {0}}-
1695 ,-
1696 {-1, 0x0800|1|(1*0x0020), ((void*)(long int)(1)), 0, minmaxFunc, 0, 0, 0, "max", {0} },-
1697 {0, 0x0800|1|(1*0x0020), ((void*)(long int)(1)), 0, 0, 0, 0, 0, "max", {0} },-
1698 {1, 1|(1*0x0020)|0x1000, ((void*)(long int)(1)), 0, minmaxStep,minMaxFinalize,minMaxValue,0,"max", {0}}-
1699 ,-
1700 {1,0x0800|1|(0*0x0020)|0x0080, ((void*)(long int)(0)), 0, typeofFunc, 0, 0, 0, "typeof", {0} },-
1701 {1,0x0800|1|(0*0x0020)|0x0040, ((void*)(long int)(0)), 0, lengthFunc, 0, 0, 0, "length", {0} },-
1702 {2, 0x0800|1|(0*0x0020), ((void*)(long int)(0)), 0, instrFunc, 0, 0, 0, "instr", {0} },-
1703 {-1, 0x0800|1|(0*0x0020), ((void*)(long int)(0)), 0, printfFunc, 0, 0, 0, "printf", {0} },-
1704 {1, 0x0800|1|(0*0x0020), ((void*)(long int)(0)), 0, unicodeFunc, 0, 0, 0, "unicode", {0} },-
1705 {-1, 0x0800|1|(0*0x0020), ((void*)(long int)(0)), 0, charFunc, 0, 0, 0, "char", {0} },-
1706 {1, 0x0800|1|(0*0x0020), ((void*)(long int)(0)), 0, absFunc, 0, 0, 0, "abs", {0} },-
1707-
1708 {1, 0x0800|1|(0*0x0020), ((void*)(long int)(0)), 0, roundFunc, 0, 0, 0, "round", {0} },-
1709 {2, 0x0800|1|(0*0x0020), ((void*)(long int)(0)), 0, roundFunc, 0, 0, 0, "round", {0} },-
1710-
1711 {1, 0x0800|1|(0*0x0020), ((void*)(long int)(0)), 0, upperFunc, 0, 0, 0, "upper", {0} },-
1712 {1, 0x0800|1|(0*0x0020), ((void*)(long int)(0)), 0, lowerFunc, 0, 0, 0, "lower", {0} },-
1713 {1, 0x0800|1|(0*0x0020), ((void*)(long int)(0)), 0, hexFunc, 0, 0, 0, "hex", {0} },-
1714 {2,0x0800|1|(0*0x0020)|0x0200, ((void*)(long int)(0)), 0, versionFunc, 0, 0, 0, "ifnull", {0} },-
1715 {0, 1|(0*0x0020), ((void*)(long int)(0)), 0, randomFunc, 0, 0, 0, "random", {0} },-
1716 {1, 1|(0*0x0020), ((void*)(long int)(0)), 0, randomBlob, 0, 0, 0, "randomblob", {0} },-
1717 {2, 0x0800|1|(1*0x0020), ((void*)(long int)(0)), 0, nullifFunc, 0, 0, 0, "nullif", {0} },-
1718 {0, 0x2000|1, 0, 0, versionFunc, 0, 0, 0, "sqlite_version", {0} },-
1719 {0, 0x2000|1, 0, 0, sourceidFunc, 0, 0, 0, "sqlite_source_id", {0} },-
1720 {2, 0x0800|1|(0*0x0020), ((void*)(long int)(0)), 0, errlogFunc, 0, 0, 0, "sqlite_log", {0} },-
1721 {1, 0x0800|1|(0*0x0020), ((void*)(long int)(0)), 0, quoteFunc, 0, 0, 0, "quote", {0} },-
1722 {0, 1|(0*0x0020), ((void*)(long int)(0)), 0, last_insert_rowid, 0, 0, 0, "last_insert_rowid", {0} },-
1723 {0, 1|(0*0x0020), ((void*)(long int)(0)), 0, changes, 0, 0, 0, "changes", {0} },-
1724 {0, 1|(0*0x0020), ((void*)(long int)(0)), 0, total_changes, 0, 0, 0, "total_changes", {0} },-
1725 {3, 0x0800|1|(0*0x0020), ((void*)(long int)(0)), 0, replaceFunc, 0, 0, 0, "replace", {0} },-
1726 {1, 0x0800|1|(0*0x0020), ((void*)(long int)(0)), 0, zeroblobFunc, 0, 0, 0, "zeroblob", {0} },-
1727 {2, 0x0800|1|(0*0x0020), ((void*)(long int)(0)), 0, substrFunc, 0, 0, 0, "substr", {0} },-
1728 {3, 0x0800|1|(0*0x0020), ((void*)(long int)(0)), 0, substrFunc, 0, 0, 0, "substr", {0} },-
1729 {1, 1|(0*0x0020)|0, ((void*)(long int)(0)), 0, sumStep,sumFinalize,sumFinalize,sumInverse,"sum", {0}},-
1730 {1, 1|(0*0x0020)|0, ((void*)(long int)(0)), 0, sumStep,totalFinalize,totalFinalize,sumInverse,"total", {0}},-
1731 {1, 1|(0*0x0020)|0, ((void*)(long int)(0)), 0, sumStep,avgFinalize,avgFinalize,sumInverse,"avg", {0}},-
1732 {0, 1|(0*0x0020)|0x0100, ((void*)(long int)(0)), 0, countStep,countFinalize,countFinalize,countInverse,"count", {0}}-
1733 ,-
1734 {1, 1|(0*0x0020)|0, ((void*)(long int)(0)), 0, countStep,countFinalize,countFinalize,countInverse,"count", {0}}-
1735 ,-
1736 {1, 1|(0*0x0020)|0, ((void*)(long int)(0)), 0, groupConcatStep,groupConcatFinalize,groupConcatValue,groupConcatInverse,"group_concat", {0}}-
1737 ,-
1738 {2, 1|(0*0x0020)|0, ((void*)(long int)(0)), 0, groupConcatStep,groupConcatFinalize,groupConcatValue,groupConcatInverse,"group_concat", {0}}-
1739 ,-
1740-
1741 {2, 0x0800|1|0x0004|0x0008, (void *)&globInfo, 0, likeFunc, 0, 0, 0, "glob", {0} },-
1742-
1743-
1744-
1745-
1746 {2, 0x0800|1|0x0004, (void *)&likeInfoNorm, 0, likeFunc, 0, 0, 0, "like", {0} },-
1747 {3, 0x0800|1|0x0004, (void *)&likeInfoNorm, 0, likeFunc, 0, 0, 0, "like", {0} },-
1748-
1749-
1750-
1751-
1752 {1, 0x0800|1|(0*0x0020), ((void*)(long int)(0)), 0, 0, 0, 0, 0, "coalesce", {0} },-
1753 {0, 0x0800|1|(0*0x0020), ((void*)(long int)(0)), 0, 0, 0, 0, 0, "coalesce", {0} },-
1754 {-1,0x0800|1|(0*0x0020)|0x0200, ((void*)(long int)(0)), 0, versionFunc, 0, 0, 0, "coalesce", {0} },-
1755 };-
1756-
1757 sqlite3AlterFunctions();-
1758-
1759 sqlite3WindowFunctions();-
1760-
1761-
1762-
1763 sqlite3RegisterDateTimeFunctions();-
1764 sqlite3InsertBuiltinFuncs(aBuiltinFunc, ((int)(sizeof(aBuiltinFunc)/sizeof(aBuiltinFunc[0]))));-
1765}
executed 534 times by 438 tests: end of block
Executed by:
  • Self test
  • Self test (10)
  • Self test (100)
  • Self test (101)
  • Self test (102)
  • 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)
  • ...
534
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.2