line |
true |
false |
branch |
41
|
127 |
226 |
if((db->flags & SQLITE_Initialized)==0 && db->init.busy==0 ){ |
|
0 |
127 |
if((db->flags & SQLITE_Initialized)==0 && db->init.busy==0 ){ |
43
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
48
|
706 |
353 |
for(i=0; inDb; i++){ |
50
|
658 |
48 |
if( !db->aDb[i].inTrans ){ |
71
|
79 |
269 |
if( v==0 && (v = sqliteGetVdbe(pParse))!=0 ){ |
|
79 |
0 |
if( v==0 && (v = sqliteGetVdbe(pParse))!=0 ){ |
74
|
0 |
348 |
if( sqlite_malloc_failed ) return; |
75
|
348 |
0 |
if( v && pParse->nErr==0 ){ |
|
342 |
6 |
if( v && pParse->nErr==0 ){ |
76
|
0 |
342 |
FILE *trace = (db->flags & SQLITE_VdbeTrace)!=0 ? stdout : 0; |
79
|
0 |
342 |
pParse->rc = pParse->nErr ? SQLITE_ERROR : SQLITE_DONE; |
81
|
6 |
0 |
}else if( pParse->rc==SQLITE_OK ){ |
108
|
596 |
99 |
for(i=0; inDb; i++){ |
109
|
596 |
0 |
int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ |
110
|
168 |
428 |
if( zDatabase!=0 && sqliteStrICmp(zDatabase, db->aDb[j].zName) ) continue; |
|
57 |
111 |
if( zDatabase!=0 && sqliteStrICmp(zDatabase, db->aDb[j].zName) ) continue; |
112
|
229 |
310 |
if( p ) break; |
132
|
0 |
164 |
if( p==0 ){ |
133
|
0 |
0 |
if( zDbase ){ |
135
|
0 |
0 |
}else if( sqliteFindTable(pParse->db, zName, 0)!=0 ){ |
160
|
186 |
93 |
for(i=0; inDb; i++){ |
161
|
186 |
0 |
int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ |
162
|
0 |
186 |
if( zDb && sqliteStrICmp(zDb, db->aDb[j].zName) ) continue; |
|
0 |
0 |
if( zDb && sqliteStrICmp(zDb, db->aDb[j].zName) ) continue; |
164
|
0 |
186 |
if( p ) break; |
183
|
0 |
8 |
if( pOld!=0 && pOld!=p ){ |
|
0 |
0 |
if( pOld!=0 && pOld!=p ){ |
196
|
0 |
0 |
if( pIndex->pTable->pIndex==pIndex ){ |
200
|
0 |
0 |
for(p=pIndex->pTable->pIndex; p && p->pNext!=pIndex; p=p->pNext){} |
|
0 |
0 |
for(p=pIndex->pTable->pIndex; p && p->pNext!=pIndex; p=p->pNext){} |
201
|
0 |
0 |
if( p && p->pNext==pIndex ){ |
|
0 |
0 |
if( p && p->pNext==pIndex ){ |
226
|
60 |
30 |
for(i=iDb; inDb; i++){ |
233
|
0 |
60 |
for(pElem=sqliteHashFirst(&temp2); pElem; pElem=sqliteHashNext(pElem)){ |
239
|
81 |
60 |
for(pElem=sqliteHashFirst(&temp1); pElem; pElem=sqliteHashNext(pElem)){ |
245
|
0 |
60 |
if( iDb>0 ) return; |
256
|
60 |
30 |
for(i=0; inDb; i++){ |
258
|
50 |
10 |
if( pDb->pBt==0 ){ |
259
|
0 |
50 |
if( pDb->pAux && pDb->xFreeAux ) pDb->xFreeAux(pDb->pAux); |
|
0 |
0 |
if( pDb->pAux && pDb->xFreeAux ) pDb->xFreeAux(pDb->pAux); |
263
|
0 |
30 |
for(i=j=2; inDb; i++){ |
265
|
0 |
0 |
if( pDb->pBt==0 ){ |
270
|
0 |
0 |
if( j
|
277
|
30 |
0 |
if( db->nDb<=2 && db->aDb!=db->aDbStatic ){ |
|
0 |
30 |
if( db->nDb<=2 && db->aDb!=db->aDbStatic ){ |
290
|
0 |
2 |
if( db->flags & SQLITE_InternChanges ){ |
323
|
0 |
98 |
if( pTable==0 ) return; |
327
|
8 |
98 |
for(pIndex = pTable->pIndex; pIndex; pIndex=pNext){ |
336
|
0 |
98 |
for(pFKey=pTable->pFKey; pFKey; pFKey=pNextFKey){ |
346
|
378 |
98 |
for(i=0; inCol; i++){ |
368
|
0 |
11 |
for(pF1=p->pFKey; pF1; pF1=pF1->pNextFrom){ |
371
|
0 |
0 |
if( pF2==pF1 ){ |
374
|
0 |
0 |
while( pF2 && pF2->pNextTo!=pF1 ){ pF2=pF2->pNextTo; } |
|
0 |
0 |
while( pF2 && pF2->pNextTo!=pF1 ){ pF2=pF2->pNextTo; } |
375
|
0 |
0 |
if( pF2 ){ |
439
|
0 |
92 |
if( zName==0 ) return; |
440
|
27 |
65 |
if( db->init.iDb==1 ) isTemp = 1; |
445
|
28 |
64 |
char *zDb = isTemp ? "temp" : "main"; |
446
|
28 |
64 |
if( sqliteAuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(isTemp), 0, zDb) ){ |
|
0 |
92 |
if( sqliteAuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(isTemp), 0, zDb) ){ |
450
|
0 |
92 |
if( isView ){ |
451
|
0 |
0 |
if( isTemp ){ |
457
|
28 |
64 |
if( isTemp ){ |
463
|
0 |
92 |
if( sqliteAuthCheck(pParse, code, zName, 0, zDb) ){ |
474
|
28 |
64 |
if( isTemp && db->aDb[1].pBt==0 && !pParse->explain ){ |
|
25 |
3 |
if( isTemp && db->aDb[1].pBt==0 && !pParse->explain ){ |
|
25 |
0 |
if( isTemp && db->aDb[1].pBt==0 && !pParse->explain ){ |
476
|
0 |
25 |
if( rc!=SQLITE_OK ){ |
482
|
0 |
25 |
if( db->flags & SQLITE_InTrans ){ |
484
|
0 |
0 |
if( rc!=SQLITE_OK ){ |
500
|
64 |
28 |
iDb = isTemp ? 1 : db->init.iDb; |
501
|
0 |
92 |
if( pTable!=0 && (pTable->iDb==iDb || !db->init.busy) ){ |
|
0 |
0 |
if( pTable!=0 && (pTable->iDb==iDb || !db->init.busy) ){ |
|
0 |
0 |
if( pTable!=0 && (pTable->iDb==iDb || !db->init.busy) ){ |
506
|
0 |
92 |
if( (pIdx = sqliteFindIndex(db, zName, 0))!=0 && |
|
0 |
0 |
if( (pIdx = sqliteFindIndex(db, zName, 0))!=0 && |
507
|
0 |
0 |
(pIdx->iDb==0 || !db->init.busy) ){ |
513
|
0 |
92 |
if( pTable==0 ){ |
523
|
0 |
92 |
if( pParse->pNewTable ) sqliteDeleteTable(db, pParse->pNewTable); |
534
|
22 |
70 |
if( !db->init.busy && (v = sqliteGetVdbe(pParse))!=0 ){ |
|
22 |
0 |
if( !db->init.busy && (v = sqliteGetVdbe(pParse))!=0 ){ |
536
|
21 |
1 |
if( !isTemp ){ |
561
|
0 |
351 |
if( (p = pParse->pNewTable)==0 ) return; |
563
|
0 |
351 |
if( z==0 ) return; |
565
|
593 |
351 |
for(i=0; inCol; i++){ |
566
|
0 |
593 |
if( sqliteStrICmp(z, p->aCol[i].zName)==0 ){ |
572
|
92 |
259 |
if( (p->nCol & 0x7)==0 ){ |
575
|
0 |
92 |
if( aNew==0 ) return; |
594
|
0 |
22 |
if( (p = pParse->pNewTable)==0 ) return; |
596
|
22 |
0 |
if( i>=0 ) p->aCol[i].notNull = onError; |
614
|
0 |
312 |
if( (p = pParse->pNewTable)==0 ) return; |
616
|
0 |
312 |
if( i<0 ) return; |
622
|
0 |
312 |
if( z==0 ) return; |
623
|
1577 |
312 |
for(i=j=0; z[i]; i++){ |
625
|
16 |
1561 |
if( isspace(c) ) continue; |
629
|
187 |
125 |
if( pParse->db->file_format>=4 ){ |
648
|
0 |
0 |
if( (p = pParse->pNewTable)==0 ) return; |
650
|
0 |
0 |
if( i<0 ) return; |
652
|
0 |
0 |
if( minusFlag ){ |
684
|
0 |
4 |
if( pTab==0 ) goto primary_key_exit; |
685
|
0 |
4 |
if( pTab->hasPrimKey ){ |
691
|
2 |
2 |
if( pList==0 ){ |
695
|
3 |
2 |
for(i=0; inId; i++){ |
696
|
4 |
0 |
for(iCol=0; iColnCol; iCol++){ |
697
|
3 |
1 |
if( sqliteStrICmp(pList->a[i].zName, pTab->aCol[iCol].zName)==0 ) break; |
699
|
3 |
0 |
if( iColnCol ) pTab->aCol[iCol].isPrimKey = 1; |
701
|
1 |
1 |
if( pList->nId>1 ) iCol = -1; |
703
|
3 |
1 |
if( iCol>=0 && iColnCol ){ |
|
3 |
0 |
if( iCol>=0 && iColnCol ){ |
706
|
4 |
0 |
if( pParse->db->file_format>=1 && |
|
3 |
1 |
if( pParse->db->file_format>=1 && |
707
|
0 |
3 |
zType && sqliteStrICmp(zType, "INTEGER")==0 ){ |
730
|
337 |
46 |
for(i=0; i
|
732
|
336 |
1 |
if( (c=='b' || c=='c') && sqliteStrNICmp(zType, "lob", 3)==0 ){ |
|
24 |
312 |
if( (c=='b' || c=='c') && sqliteStrNICmp(zType, "lob", 3)==0 ){ |
|
1 |
24 |
if( (c=='b' || c=='c') && sqliteStrNICmp(zType, "lob", 3)==0 ){ |
735
|
24 |
312 |
if( c=='c' && sqliteStrNICmp(zType, "har", 3)==0 ){ |
|
24 |
0 |
if( c=='c' && sqliteStrNICmp(zType, "har", 3)==0 ){ |
738
|
162 |
150 |
if( c=='t' && sqliteStrNICmp(zType, "ext", 3)==0 ){ |
|
116 |
46 |
if( c=='t' && sqliteStrNICmp(zType, "ext", 3)==0 ){ |
754
|
0 |
0 |
if( (p = pParse->pNewTable)==0 ) return; |
756
|
0 |
0 |
if( i>=0 ) p->aCol[i].sortOrder = collType; |
777
|
32 |
1 |
if( db->next_cookie==db->aDb[0].schema_cookie ){ |
795
|
0 |
0 |
for(n=0; *z; n++, z++){ |
796
|
0 |
0 |
if( *z=='\'' ){ n++; needQuote=1; } |
808
|
0 |
0 |
for(j=0; zIdent[j]; j++){ |
809
|
0 |
0 |
if( !isalnum(zIdent[j]) && zIdent[j]!='_' ) break; |
|
0 |
0 |
if( !isalnum(zIdent[j]) && zIdent[j]!='_' ) break; |
811
|
0 |
0 |
needQuote = zIdent[j]!=0 || isdigit(zIdent[0]) |
812
|
0 |
0 |
|| sqliteKeywordCode(zIdent, j)!=TK_ID; |
|
0 |
0 |
|| sqliteKeywordCode(zIdent, j)!=TK_ID; |
813
|
0 |
0 |
if( needQuote ) z[i++] = '\''; |
814
|
0 |
0 |
for(j=0; zIdent[j]; j++){ |
816
|
0 |
0 |
if( zIdent[j]=='\'' ) z[i++] = '\''; |
818
|
0 |
0 |
if( needQuote ) z[i++] = '\''; |
833
|
0 |
0 |
for(i=0; inCol; i++){ |
837
|
0 |
0 |
if( n<40 ){ |
848
|
0 |
0 |
if( zStmt==0 ) return 0; |
849
|
0 |
0 |
strcpy(zStmt, p->iDb==1 ? "CREATE TEMP TABLE " : "CREATE TABLE "); |
853
|
0 |
0 |
for(i=0; inCol; i++){ |
887
|
0 |
92 |
if( (pEnd==0 && pSelect==0) || pParse->nErr || sqlite_malloc_failed ) return; |
|
0 |
0 |
if( (pEnd==0 && pSelect==0) || pParse->nErr || sqlite_malloc_failed ) return; |
|
92 |
0 |
if( (pEnd==0 && pSelect==0) || pParse->nErr || sqlite_malloc_failed ) return; |
|
0 |
92 |
if( (pEnd==0 && pSelect==0) || pParse->nErr || sqlite_malloc_failed ) return; |
889
|
0 |
92 |
if( p==0 ) return; |
894
|
0 |
92 |
if( pSelect ){ |
896
|
0 |
0 |
if( pSelTab==0 ) return; |
911
|
70 |
22 |
if( db->init.busy ){ |
922
|
22 |
70 |
if( !db->init.busy ){ |
927
|
0 |
22 |
if( v==0 ) return; |
928
|
22 |
0 |
if( p->pSelect==0 ){ |
937
|
22 |
0 |
sqliteVdbeOp3(v, OP_String, 0, 0, p->pSelect==0?"table":"view", P3_STATIC); |
942
|
0 |
22 |
if( pSelect ){ |
944
|
0 |
0 |
n = z ? strlen(z) : 0; |
954
|
21 |
1 |
if( !p->iDb ){ |
958
|
0 |
22 |
if( pSelect ){ |
969
|
92 |
0 |
if( pParse->explain==0 && pParse->nErr==0 ){ |
|
92 |
0 |
if( pParse->explain==0 && pParse->nErr==0 ){ |
974
|
0 |
92 |
if( pOld ){ |
978
|
0 |
92 |
for(pFKey=p->pFKey; pFKey; pFKey=pFKey->pNextFrom){ |
1007
|
0 |
0 |
if( p==0 || pParse->nErr ){ |
|
0 |
0 |
if( p==0 || pParse->nErr ){ |
1011
|
0 |
0 |
if( sqliteFixInit(&sFix, pParse, p->iDb, "view", pName) |
1012
|
0 |
0 |
&& sqliteFixSelect(&sFix, pSelect) |
1025
|
0 |
0 |
if( !pParse->db->init.busy ){ |
1033
|
0 |
0 |
if( sEnd.z[0]!=0 && sEnd.z[0]!=';' ){ |
|
0 |
0 |
if( sEnd.z[0]!=0 && sEnd.z[0]!=';' ){ |
1039
|
0 |
0 |
while( n>0 && (z[n-1]==';' || isspace(z[n-1])) ){ n--; } |
|
0 |
0 |
while( n>0 && (z[n-1]==';' || isspace(z[n-1])) ){ n--; } |
|
0 |
0 |
while( n>0 && (z[n-1]==';' || isspace(z[n-1])) ){ n--; } |
1064
|
0 |
0 |
if( pTable->nCol>0 ) return 0; |
1076
|
0 |
0 |
if( pTable->nCol<0 ){ |
1093
|
0 |
0 |
if( pSel->pEList==0 ){ |
1099
|
0 |
0 |
if( pSelTab ){ |
1129
|
0 |
0 |
for(i=0, pCol=pTable->aCol; inCol; i++, pCol++){ |
1144
|
11 |
0 |
if( !DbHasProperty(db, idx, DB_UnresetViews) ) return; |
1145
|
0 |
0 |
for(i=sqliteHashFirst(&db->aDb[idx].tblHash); i; i=sqliteHashNext(i)){ |
1147
|
0 |
0 |
if( pTab->pSelect ){ |
1162
|
0 |
17 |
if( zName==0 ) return 0; |
1165
|
6 |
11 |
if( pTab==0 ){ |
1182
|
17 |
0 |
if( pParse->nErr || sqlite_malloc_failed ) return; |
|
0 |
17 |
if( pParse->nErr || sqlite_malloc_failed ) return; |
1184
|
6 |
11 |
if( pTable==0 ) return; |
1190
|
0 |
11 |
const char *zTab = SCHEMA_TABLE(pTable->iDb); |
1192
|
0 |
11 |
if( sqliteAuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb)){ |
1195
|
0 |
11 |
if( isView ){ |
1196
|
0 |
0 |
if( iDb==1 ){ |
1202
|
0 |
11 |
if( iDb==1 ){ |
1208
|
0 |
11 |
if( sqliteAuthCheck(pParse, code, pTable->zName, 0, zDb) ){ |
1211
|
0 |
11 |
if( sqliteAuthCheck(pParse, SQLITE_DELETE, pTable->zName, 0, zDb) ){ |
1216
|
0 |
11 |
if( pTable->readOnly ){ |
1221
|
0 |
11 |
if( isView && pTable->pSelect==0 ){ |
|
0 |
0 |
if( isView && pTable->pSelect==0 ){ |
1225
|
11 |
0 |
if( !isView && pTable->pSelect ){ |
|
0 |
11 |
if( !isView && pTable->pSelect ){ |
1234
|
11 |
0 |
if( v ){ |
1251
|
0 |
11 |
while( pTrigger ){ |
1254
|
0 |
0 |
if( pParse->explain ){ |
1267
|
11 |
0 |
if( pTable->iDb!=1 ){ |
1273
|
11 |
0 |
if( pTable->iDb==0 ){ |
1277
|
11 |
0 |
if( !isView ){ |
1279
|
0 |
11 |
for(pIdx=pTable->pIndex; pIdx; pIdx=pIdx->pNext){ |
1291
|
11 |
0 |
if( !pParse->explain ){ |
1316
|
0 |
3 |
if( zType==0 ) return; |
1317
|
4 |
3 |
for(i=0; i
|
1320
|
2 |
2 |
if( (pTab->aCol[iCol].sortOrder & SQLITE_SO_TYPEMASK)==SQLITE_SO_TEXT ){ |
1364
|
0 |
0 |
if( p==0 || pParse->nErr ) goto fk_end; |
|
0 |
0 |
if( p==0 || pParse->nErr ) goto fk_end; |
1365
|
0 |
0 |
if( pFromCol==0 ){ |
1367
|
0 |
0 |
if( iCol<0 ) goto fk_end; |
1368
|
0 |
0 |
if( pToCol && pToCol->nId!=1 ){ |
|
0 |
0 |
if( pToCol && pToCol->nId!=1 ){ |
1375
|
0 |
0 |
}else if( pToCol && pToCol->nId!=pFromCol->nId ){ |
|
0 |
0 |
}else if( pToCol && pToCol->nId!=pFromCol->nId ){ |
1384
|
0 |
0 |
if( pToCol ){ |
1385
|
0 |
0 |
for(i=0; inId; i++){ |
1390
|
0 |
0 |
if( pFKey==0 ) goto fk_end; |
1402
|
0 |
0 |
if( pFromCol==0 ){ |
1405
|
0 |
0 |
for(i=0; i
|
1407
|
0 |
0 |
for(j=0; jnCol; j++){ |
1408
|
0 |
0 |
if( sqliteStrICmp(p->aCol[j].zName, pFromCol->a[i].zName)==0 ){ |
1413
|
0 |
0 |
if( j>=p->nCol ){ |
1421
|
0 |
0 |
if( pToCol ){ |
1422
|
0 |
0 |
for(i=0; i
|
1456
|
0 |
0 |
if( (pTab = pParse->pNewTable)==0 || (pFKey = pTab->pFKey)==0 ) return; |
|
0 |
0 |
if( (pTab = pParse->pNewTable)==0 || (pFKey = pTab->pFKey)==0 ) return; |
1490
|
8 |
0 |
if( pParse->nErr || sqlite_malloc_failed ) goto exit_create_index; |
|
8 |
0 |
if( pParse->nErr || sqlite_malloc_failed ) goto exit_create_index; |
1491
|
3 |
5 |
if( db->init.busy |
1492
|
3 |
0 |
&& sqliteFixInit(&sFix, pParse, db->init.iDb, "index", pName) |
1493
|
0 |
3 |
&& sqliteFixSrcList(&sFix, pTable) |
1501
|
4 |
4 |
if( pTable!=0 ){ |
1509
|
8 |
0 |
if( pTab==0 || pParse->nErr ) goto exit_create_index; |
|
8 |
0 |
if( pTab==0 || pParse->nErr ) goto exit_create_index; |
1510
|
0 |
8 |
if( pTab->readOnly ){ |
1514
|
0 |
8 |
if( pTab->iDb>=2 && db->init.busy==0 ){ |
|
0 |
0 |
if( pTab->iDb>=2 && db->init.busy==0 ){ |
1518
|
0 |
8 |
if( pTab->pSelect ){ |
1537
|
4 |
4 |
if( pName && !db->init.busy ){ |
|
1 |
3 |
if( pName && !db->init.busy ){ |
1541
|
0 |
1 |
if( zName==0 ) goto exit_create_index; |
1542
|
0 |
1 |
if( (pISameName = sqliteFindIndex(db, zName, 0))!=0 ){ |
1546
|
0 |
1 |
if( (pTSameName = sqliteFindTable(db, zName, 0))!=0 ){ |
1550
|
4 |
3 |
}else if( pName==0 ){ |
1554
|
0 |
4 |
for(pLoop=pTab->pIndex, n=1; pLoop; pLoop=pLoop->pNext, n++){} |
1558
|
0 |
4 |
if( zName==0 ) goto exit_create_index; |
1570
|
0 |
8 |
if( sqliteAuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(isTemp), 0, zDb) ){ |
|
0 |
8 |
if( sqliteAuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(isTemp), 0, zDb) ){ |
1574
|
0 |
8 |
if( isTemp ) i = SQLITE_CREATE_TEMP_INDEX; |
1575
|
0 |
8 |
if( sqliteAuthCheck(pParse, i, zName, pTab->zName, zDb) ){ |
1585
|
2 |
6 |
if( pList==0 ){ |
1589
|
0 |
2 |
if( pList==0 ) goto exit_create_index; |
1597
|
0 |
8 |
if( pIndex==0 ) goto exit_create_index; |
1605
|
8 |
0 |
pIndex->iDb = isTemp ? 1 : db->init.iDb; |
1611
|
9 |
8 |
for(i=0; inId; i++){ |
1612
|
11 |
0 |
for(j=0; jnCol; j++){ |
1613
|
9 |
2 |
if( sqliteStrICmp(pList->a[i].zName, pTab->aCol[j].zName)==0 ) break; |
1615
|
0 |
9 |
if( j>=pTab->nCol ){ |
1627
|
8 |
0 |
if( !pParse->explain ){ |
1631
|
0 |
8 |
if( p ){ |
1644
|
0 |
8 |
if( onError!=OE_Replace || pTab->pIndex==0 |
|
0 |
0 |
if( onError!=OE_Replace || pTab->pIndex==0 |
1645
|
0 |
0 |
|| pTab->pIndex->onError==OE_Replace){ |
1650
|
0 |
0 |
while( pOther->pNext && pOther->pNext->onError!=OE_Replace ){ |
|
0 |
0 |
while( pOther->pNext && pOther->pNext->onError!=OE_Replace ){ |
1661
|
3 |
5 |
if( db->init.busy && pTable!=0 ){ |
|
3 |
0 |
if( db->init.busy && pTable!=0 ){ |
1680
|
5 |
0 |
else if( db->init.busy==0 ){ |
1688
|
0 |
5 |
if( v==0 ) goto exit_create_index; |
1689
|
1 |
4 |
if( pTable!=0 ){ |
1699
|
1 |
4 |
if( pTable ){ |
1707
|
1 |
4 |
if( pStart && pEnd ){ |
|
1 |
0 |
if( pStart && pEnd ){ |
1713
|
1 |
4 |
if( pTable ){ |
1719
|
1 |
1 |
for(i=0; inColumn; i++){ |
1721
|
0 |
1 |
if( pTab->iPKey==iCol ){ |
1728
|
1 |
0 |
if( db->file_format>=4 ) sqliteAddIdxKeyType(v, pIndex); |
1736
|
1 |
4 |
if( pTable!=0 ){ |
1737
|
1 |
0 |
if( !isTemp ){ |
1762
|
0 |
0 |
if( pParse->nErr || sqlite_malloc_failed ) return; |
|
0 |
0 |
if( pParse->nErr || sqlite_malloc_failed ) return; |
1765
|
0 |
0 |
if( pIndex==0 ){ |
1769
|
0 |
0 |
if( pIndex->autoIndex ){ |
1774
|
0 |
0 |
if( pIndex->iDb>1 ){ |
1784
|
0 |
0 |
const char *zTab = SCHEMA_TABLE(pIndex->iDb); |
1785
|
0 |
0 |
if( sqliteAuthCheck(pParse, SQLITE_DELETE, zTab, 0, zDb) ){ |
1788
|
0 |
0 |
if( pIndex->iDb ) code = SQLITE_DROP_TEMP_INDEX; |
1789
|
0 |
0 |
if( sqliteAuthCheck(pParse, code, pIndex->zName, pTab->zName, zDb) ){ |
1797
|
0 |
0 |
if( v ){ |
1815
|
0 |
0 |
if( pIndex->iDb==0 ){ |
1825
|
0 |
0 |
if( !pParse->explain ){ |
1841
|
11 |
4 |
if( pList==0 ){ |
1843
|
0 |
11 |
if( pList==0 ) return 0; |
1846
|
11 |
4 |
if( pList->nId>=pList->nAlloc ){ |
1850
|
0 |
11 |
if( a==0 ){ |
1857
|
15 |
0 |
if( pToken ){ |
1860
|
0 |
15 |
if( *pz==0 ){ |
1897
|
169 |
1 |
if( pList==0 ){ |
1899
|
0 |
169 |
if( pList==0 ) return 0; |
1902
|
1 |
169 |
if( pList->nSrc>=pList->nAlloc ){ |
1907
|
0 |
1 |
if( pNew==0 ){ |
1914
|
164 |
6 |
if( pDatabase && pDatabase->z==0 ){ |
|
110 |
54 |
if( pDatabase && pDatabase->z==0 ){ |
1917
|
54 |
116 |
if( pDatabase && pTable ){ |
|
54 |
0 |
if( pDatabase && pTable ){ |
1922
|
164 |
6 |
if( pTable ){ |
1925
|
0 |
164 |
if( *pz==0 ){ |
1932
|
54 |
116 |
if( pDatabase ){ |
1935
|
0 |
54 |
if( *pz==0 ){ |
1952
|
116 |
138 |
for(i=0; inSrc; i++){ |
1953
|
116 |
0 |
if( pList->a[i].iCursor<0 ){ |
1963
|
0 |
0 |
if( pList && pList->nSrc>0 ){ |
|
0 |
0 |
if( pList && pList->nSrc>0 ){ |
1975
|
215 |
11 |
if( pList==0 ) return; |
1976
|
15 |
11 |
for(i=0; inId; i++){ |
1989
|
0 |
0 |
if( pList==0 ) return -1; |
1990
|
0 |
0 |
for(i=0; inId; i++){ |
1991
|
0 |
0 |
if( sqliteStrICmp(pList->a[i].zName, zName)==0 ) return i; |
2001
|
4 |
192 |
if( pList==0 ) return; |
2002
|
170 |
192 |
for(i=0; inSrc; i++){ |
2006
|
167 |
3 |
if( pList->a[i].pTab && pList->a[i].pTab->isTransient ){ |
|
3 |
164 |
if( pList->a[i].pTab && pList->a[i].pTab->isTransient ){ |
2022
|
6 |
0 |
if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return; |
|
6 |
0 |
if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return; |
|
0 |
6 |
if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return; |
2023
|
6 |
0 |
if( pParse->nErr || sqlite_malloc_failed ) return; |
|
0 |
6 |
if( pParse->nErr || sqlite_malloc_failed ) return; |
2024
|
0 |
6 |
if( sqliteAuthCheck(pParse, SQLITE_TRANSACTION, "BEGIN", 0, 0) ) return; |
2025
|
0 |
6 |
if( db->flags & SQLITE_InTrans ){ |
2030
|
6 |
0 |
if( !pParse->explain ){ |
2042
|
2 |
0 |
if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return; |
|
2 |
0 |
if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return; |
|
0 |
2 |
if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return; |
2043
|
2 |
0 |
if( pParse->nErr || sqlite_malloc_failed ) return; |
|
0 |
2 |
if( pParse->nErr || sqlite_malloc_failed ) return; |
2044
|
0 |
2 |
if( sqliteAuthCheck(pParse, SQLITE_TRANSACTION, "COMMIT", 0, 0) ) return; |
2045
|
0 |
2 |
if( (db->flags & SQLITE_InTrans)==0 ){ |
2049
|
2 |
0 |
if( !pParse->explain ){ |
2053
|
2 |
0 |
if( !pParse->explain ){ |
2065
|
4 |
0 |
if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return; |
|
4 |
0 |
if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return; |
|
0 |
4 |
if( pParse==0 || (db=pParse->db)==0 || db->aDb[0].pBt==0 ) return; |
2066
|
4 |
0 |
if( pParse->nErr || sqlite_malloc_failed ) return; |
|
0 |
4 |
if( pParse->nErr || sqlite_malloc_failed ) return; |
2067
|
0 |
4 |
if( sqliteAuthCheck(pParse, SQLITE_TRANSACTION, "ROLLBACK", 0, 0) ) return; |
2068
|
0 |
4 |
if( (db->flags & SQLITE_InTrans)==0 ){ |
2073
|
4 |
0 |
if( v ){ |
2076
|
4 |
0 |
if( !pParse->explain ){ |
2091
|
160 |
109 |
if( iDb!=1 && !DbHasProperty(db, iDb, DB_Cookie) ){ |
|
147 |
13 |
if( iDb!=1 && !DbHasProperty(db, iDb, DB_Cookie) ){ |
2118
|
0 |
165 |
if( DbHasProperty(db, iDb, DB_Locked) ) return; |
2120
|
0 |
165 |
if( v==0 ) return; |
2121
|
153 |
12 |
if( !db->aDb[iDb].inTrans ){ |
2125
|
75 |
78 |
if( iDb!=1 ){ |
2128
|
0 |
12 |
}else if( setCheckpoint ){ |
2147
|
0 |
86 |
if( pParse->trigStack ) return; /* if this is in a trigger */ |
2149
|
0 |
86 |
if( v==0 ) return; |
2150
|
74 |
12 |
if( db->flags & SQLITE_InTrans ){ |