line |
true |
false |
branch |
37
|
0 |
0 |
sqliteSetString(pData->pzErrMsg, "malformed database schema", |
38
|
0 |
0 |
zExtra!=0 && zExtra[0]!=0 ? " - " : (char*)0, zExtra, (char*)0); |
61
|
2 |
73 |
if( argv==0 ) return 0; /* Might happen if EMPTY_RESULT_CALLBACKS are on */ |
62
|
0 |
73 |
if( argv[0]==0 ){ |
66
|
73 |
0 |
switch( argv[0][0] ){ |
71
|
73 |
0 |
if( argv[2]==0 || argv[4]==0 ){ |
|
0 |
73 |
if( argv[2]==0 || argv[4]==0 ){ |
75
|
73 |
0 |
if( argv[3] && argv[3][0] ){ |
|
73 |
0 |
if( argv[3] && argv[3][0] ){ |
86
|
0 |
73 |
if( sqlite_exec(db, argv[3], 0, 0, &zErr) ){ |
104
|
0 |
0 |
if( pIndex==0 || pIndex->tnum!=0 ){ |
|
0 |
0 |
if( pIndex==0 || pIndex->tnum!=0 ){ |
149
|
0 |
0 |
if( pTab ){ |
159
|
0 |
0 |
if( zErr ){ |
160
|
0 |
0 |
if( *pData->pzErrMsg ) sqlite_freemem(*pData->pzErrMsg); |
170
|
0 |
0 |
if( pTab ){ |
228
|
27 |
27 |
if( iDb==1 ){ |
250
|
54 |
0 |
if( pTab ){ |
259
|
0 |
54 |
if( db->aDb[iDb].pBt==0 ) return SQLITE_OK; |
261
|
0 |
54 |
if( rc ){ |
269
|
0 |
54 |
if( rc ){ |
275
|
27 |
27 |
if( iDb==0 ){ |
279
|
27 |
0 |
if( size==0 ){ size = MAX_PAGES; } |
282
|
0 |
27 |
if( meta[6]>0 && meta[6]<=2 && db->temp_store==0 ){ |
|
0 |
0 |
if( meta[6]>0 && meta[6]<=2 && db->temp_store==0 ){ |
|
0 |
0 |
if( meta[6]>0 && meta[6]<=2 && db->temp_store==0 ){ |
285
|
27 |
0 |
if( db->safety_level==0 ) db->safety_level = 2; |
294
|
5 |
22 |
if( db->file_format==0 ){ |
297
|
0 |
22 |
}else if( db->file_format>4 ){ |
302
|
0 |
27 |
}else if( iDb!=1 && (db->file_format!=meta[2] || db->file_format<4) ){ |
|
0 |
0 |
}else if( iDb!=1 && (db->file_format!=meta[2] || db->file_format<4) ){ |
|
0 |
0 |
}else if( iDb!=1 && (db->file_format!=meta[2] || db->file_format<4) ){ |
304
|
0 |
0 |
if( meta[2]==0 ){ |
316
|
0 |
54 |
sqliteBtreeSetSafetyLevel(db->aDb[iDb].pBt, meta[4]==0 ? 2 : meta[4]); |
337
|
54 |
0 |
if( db->file_format>=2 ){ |
353
|
0 |
54 |
if( sqlite_malloc_failed ){ |
358
|
54 |
0 |
if( rc==SQLITE_OK ){ |
382
|
0 |
27 |
if( db->init.busy ) return SQLITE_OK; |
386
|
81 |
0 |
for(i=0; rc==SQLITE_OK && inDb; i++){ |
|
54 |
27 |
for(i=0; rc==SQLITE_OK && inDb; i++){ |
387
|
54 |
0 |
if( DbHasProperty(db, i, DB_SchemaLoaded) || i==1 ) continue; |
|
27 |
27 |
if( DbHasProperty(db, i, DB_SchemaLoaded) || i==1 ) continue; |
389
|
0 |
27 |
if( rc ){ |
398
|
27 |
0 |
if( rc==SQLITE_OK && db->nDb>1 && !DbHasProperty(db, 1, DB_SchemaLoaded) ){ |
|
27 |
0 |
if( rc==SQLITE_OK && db->nDb>1 && !DbHasProperty(db, 1, DB_SchemaLoaded) ){ |
|
27 |
0 |
if( rc==SQLITE_OK && db->nDb>1 && !DbHasProperty(db, 1, DB_SchemaLoaded) ){ |
400
|
0 |
27 |
if( rc ){ |
406
|
27 |
0 |
if( rc==SQLITE_OK ){ |
416
|
27 |
0 |
if( rc==SQLITE_OK && db->file_format<3 ){ |
|
0 |
27 |
if( rc==SQLITE_OK && db->file_format<3 ){ |
430
|
0 |
0 |
if( rc==SQLITE_OK ){ |
436
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
437
|
0 |
0 |
sqliteSetString(pzErrMsg, |
444
|
0 |
27 |
if( rc!=SQLITE_OK ){ |
481
|
25 |
0 |
if( pzErrMsg ) *pzErrMsg = 0; |
482
|
0 |
25 |
if( db==0 ) goto no_mem_on_open; |
490
|
50 |
25 |
for(i=0; inDb; i++){ |
498
|
0 |
25 |
if( zFilename[0]==':' && strcmp(zFilename,":memory:")==0 ){ |
|
0 |
0 |
if( zFilename[0]==':' && strcmp(zFilename,":memory:")==0 ){ |
502
|
0 |
25 |
if( rc!=SQLITE_OK ){ |
520
|
0 |
25 |
if( sqlite_malloc_failed ){ |
523
|
0 |
25 |
}else if( rc!=SQLITE_OK && rc!=SQLITE_BUSY ){ |
|
0 |
0 |
}else if( rc!=SQLITE_OK && rc!=SQLITE_BUSY ){ |
527
|
25 |
0 |
}else if( pzErrMsg ){ |
572
|
25 |
0 |
if( sqliteSafetyCheck(db) || sqliteSafetyOn(db) ){ |
|
0 |
25 |
if( sqliteSafetyCheck(db) || sqliteSafetyOn(db) ){ |
577
|
50 |
25 |
for(j=0; jnDb; j++){ |
579
|
50 |
0 |
if( pDb->pBt ){ |
587
|
717 |
25 |
for(i=sqliteHashFirst(&db->aFunc); i; i=sqliteHashNext(i)){ |
589
|
917 |
717 |
for(pFunc = (FuncDef*)sqliteHashData(i); pFunc; pFunc=pNext){ |
603
|
10 |
5 |
for(i=0; inDb; i++){ |
604
|
10 |
0 |
if( db->aDb[i].pBt ){ |
637
|
0 |
189 |
if( zSql==0 ) return SQLITE_OK; |
638
|
378 |
0 |
while( rc==SQLITE_OK && zSql[0] ){ |
|
189 |
189 |
while( rc==SQLITE_OK && zSql[0] ){ |
641
|
0 |
189 |
if( rc!=SQLITE_OK ){ |
645
|
0 |
189 |
if( pVm==0 ){ |
655
|
19 |
189 |
if( rc==SQLITE_ROW ){ |
656
|
19 |
0 |
if( xCallback!=0 && xCallback(pArg, nArg, azArg, azCol) ){ |
|
0 |
19 |
if( xCallback!=0 && xCallback(pArg, nArg, azArg, azCol) ){ |
662
|
189 |
0 |
if( rc==SQLITE_DONE && nCallback==0 |
|
177 |
12 |
if( rc==SQLITE_DONE && nCallback==0 |
663
|
72 |
105 |
&& (db->flags & SQLITE_NullCallback)!=0 && xCallback!=0 ){ |
|
2 |
70 |
&& (db->flags & SQLITE_NullCallback)!=0 && xCallback!=0 ){ |
667
|
0 |
189 |
if( rc==SQLITE_SCHEMA && nRetry<2 ){ |
|
0 |
0 |
if( rc==SQLITE_SCHEMA && nRetry<2 ){ |
672
|
170 |
19 |
if( db->pVdbe==0 ){ |
677
|
0 |
189 |
while( isspace(zSql[0]) ) zSql++; |
700
|
295 |
54 |
if( pzErrMsg ) *pzErrMsg = 0; |
701
|
0 |
349 |
if( sqliteSafetyOn(db) ) goto exec_misuse; |
702
|
222 |
127 |
if( !db->init.busy ){ |
703
|
2 |
220 |
if( (db->flags & SQLITE_Initialized)==0 ){ |
705
|
0 |
2 |
while( (rc = sqliteInit(db, pzErrMsg))==SQLITE_BUSY |
706
|
0 |
0 |
&& db->xBusyCallback |
707
|
0 |
0 |
&& db->xBusyCallback(db->pBusyArg, "", cnt++)!=0 ){} |
708
|
0 |
2 |
if( rc!=SQLITE_OK ){ |
713
|
2 |
0 |
if( pzErrMsg ){ |
718
|
0 |
222 |
if( db->file_format<3 ){ |
725
|
330 |
19 |
if( db->pVdbe==0 ){ db->nChange = 0; } |
729
|
0 |
349 |
if( db->xTrace && !db->init.busy ){ |
|
0 |
0 |
if( db->xTrace && !db->init.busy ){ |
736
|
0 |
0 |
if( sParse.zTail && sParse.zTail!=zSql && *sParse.zTail ){ |
|
0 |
0 |
if( sParse.zTail && sParse.zTail!=zSql && *sParse.zTail ){ |
|
0 |
0 |
if( sParse.zTail && sParse.zTail!=zSql && *sParse.zTail ){ |
738
|
0 |
0 |
if( tmpSql ){ |
752
|
0 |
349 |
if( sqlite_malloc_failed ){ |
759
|
342 |
7 |
if( sParse.rc==SQLITE_DONE ) sParse.rc = SQLITE_OK; |
760
|
7 |
342 |
if( sParse.rc!=SQLITE_OK && pzErrMsg && *pzErrMsg==0 ){ |
|
7 |
0 |
if( sParse.rc!=SQLITE_OK && pzErrMsg && *pzErrMsg==0 ){ |
|
0 |
7 |
if( sParse.rc!=SQLITE_OK && pzErrMsg && *pzErrMsg==0 ){ |
764
|
0 |
349 |
if( sParse.rc==SQLITE_SCHEMA ){ |
769
|
189 |
160 |
if( pzTail ) *pzTail = sParse.zTail; |
770
|
0 |
349 |
if( sqliteSafetyOff(db) ) goto exec_misuse; |
774
|
0 |
0 |
if( pzErrMsg ){ |
879
|
0 |
0 |
if( count <= NDELAY ){ |
886
|
0 |
0 |
if( prior + delay > timeout ){ |
888
|
0 |
0 |
if( delay<=0 ) return 0; |
927
|
0 |
0 |
if( nOps>0 ){ |
945
|
25 |
0 |
if( ms>0 ){ |
1002
|
761 |
0 |
if( db==0 || zName==0 || sqliteSafetyCheck(db) ) return 1; |
|
761 |
0 |
if( db==0 || zName==0 || sqliteSafetyCheck(db) ) return 1; |
|
0 |
761 |
if( db==0 || zName==0 || sqliteSafetyCheck(db) ) return 1; |
1003
|
761 |
0 |
if( nArg<-1 || nArg>127 ) return 1; |
|
0 |
761 |
if( nArg<-1 || nArg>127 ) return 1; |
1005
|
0 |
761 |
if( nName>255 ) return 1; |
1007
|
0 |
761 |
if( p==0 ) return 1; |
1024
|
156 |
0 |
if( db==0 || zName==0 || sqliteSafetyCheck(db) ) return 1; |
|
156 |
0 |
if( db==0 || zName==0 || sqliteSafetyCheck(db) ) return 1; |
|
0 |
156 |
if( db==0 || zName==0 || sqliteSafetyCheck(db) ) return 1; |
1025
|
156 |
0 |
if( nArg<-1 || nArg>127 ) return 1; |
|
0 |
156 |
if( nArg<-1 || nArg>127 ) return 1; |
1027
|
0 |
156 |
if( nName>255 ) return 1; |
1029
|
0 |
156 |
if( p==0 ) return 1; |
1044
|
950 |
800 |
while( p ){ |
1119
|
28 |
25 |
if( zFilename==0 ){ |
1125
|
0 |
28 |
int location = db->temp_store==0 ? TEMP_STORE : db->temp_store; |
1127
|
28 |
0 |
if (location == 1) { |
1136
|
0 |
25 |
}else if( zFilename[0]==':' && strcmp(zFilename,":memory:")==0 ){ |
|
0 |
0 |
}else if( zFilename[0]==':' && strcmp(zFilename,":memory:")==0 ){ |