| line |
true |
false |
branch |
|
64
|
0 |
0 |
if( pParse->nErr || sqlite_malloc_failed ) goto update_cleanup; |
|
|
0 |
0 |
if( pParse->nErr || sqlite_malloc_failed ) goto update_cleanup; |
|
72
|
0 |
0 |
if( pTab==0 ) goto update_cleanup; |
|
77
|
0 |
0 |
row_triggers_exist = before_triggers || after_triggers; |
|
|
0 |
0 |
row_triggers_exist = before_triggers || after_triggers; |
|
79
|
0 |
0 |
if( sqliteIsReadOnly(pParse, pTab, before_triggers) ){ |
|
82
|
0 |
0 |
if( isView ){ |
|
83
|
0 |
0 |
if( sqliteViewGetColumnNames(pParse, pTab) ){ |
|
88
|
0 |
0 |
if( aXRef==0 ) goto update_cleanup; |
|
89
|
0 |
0 |
for(i=0; inCol; i++) aXRef[i] = -1; |
|
94
|
0 |
0 |
if( row_triggers_exist ){ |
|
105
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
|
116
|
0 |
0 |
for(i=0; inExpr; i++){ |
|
117
|
0 |
0 |
if( sqliteExprResolveIds(pParse, pTabList, 0, pChanges->a[i].pExpr) ){ |
|
120
|
0 |
0 |
if( sqliteExprCheck(pParse, pChanges->a[i].pExpr, 0, 0) ){ |
|
123
|
0 |
0 |
for(j=0; jnCol; j++){ |
|
124
|
0 |
0 |
if( sqliteStrICmp(pTab->aCol[j].zName, pChanges->a[i].zName)==0 ){ |
|
125
|
0 |
0 |
if( j==pTab->iPKey ){ |
|
133
|
0 |
0 |
if( j>=pTab->nCol ){ |
|
134
|
0 |
0 |
if( sqliteIsRowid(pChanges->a[i].zName) ){ |
|
147
|
0 |
0 |
if( rc==SQLITE_DENY ){ |
|
149
|
0 |
0 |
}else if( rc==SQLITE_IGNORE ){ |
|
161
|
0 |
0 |
for(nIdx=nIdxTotal=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, nIdxTotal++){ |
|
162
|
0 |
0 |
if( chngRecno ){ |
|
165
|
0 |
0 |
for(i=0; inColumn; i++){ |
|
166
|
0 |
0 |
if( aXRef[pIdx->aiColumn[i]]>=0 ) break; |
|
169
|
0 |
0 |
if( inColumn ) nIdx++; |
|
171
|
0 |
0 |
if( nIdxTotal>0 ){ |
|
173
|
0 |
0 |
if( apIdx==0 ) goto update_cleanup; |
|
176
|
0 |
0 |
for(nIdx=j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){ |
|
177
|
0 |
0 |
if( chngRecno ){ |
|
180
|
0 |
0 |
for(i=0; inColumn; i++){ |
|
181
|
0 |
0 |
if( aXRef[pIdx->aiColumn[i]]>=0 ) break; |
|
184
|
0 |
0 |
if( inColumn ){ |
|
195
|
0 |
0 |
if( pWhere ){ |
|
196
|
0 |
0 |
if( sqliteExprResolveIds(pParse, pTabList, 0, pWhere) ){ |
|
199
|
0 |
0 |
if( sqliteExprCheck(pParse, pWhere, 0, 0) ){ |
|
206
|
0 |
0 |
if( isView ){ |
|
213
|
0 |
0 |
if( v==0 ) goto update_cleanup; |
|
219
|
0 |
0 |
if( isView ){ |
|
229
|
0 |
0 |
if( pWInfo==0 ) goto update_cleanup; |
|
241
|
0 |
0 |
if( db->flags & SQLITE_CountRows && !pParse->trigStack ){ |
|
|
0 |
0 |
if( db->flags & SQLITE_CountRows && !pParse->trigStack ){ |
|
245
|
0 |
0 |
if( row_triggers_exist ){ |
|
265
|
0 |
0 |
if( !isView ){ |
|
279
|
0 |
0 |
if( chngRecno ){ |
|
284
|
0 |
0 |
for(i=0; inCol; i++){ |
|
285
|
0 |
0 |
if( i==pTab->iPKey ){ |
|
290
|
0 |
0 |
if( j<0 ){ |
|
298
|
0 |
0 |
if( !isView ){ |
|
304
|
0 |
0 |
if( sqliteCodeRowTrigger(pParse, TK_UPDATE, pChanges, TK_BEFORE, pTab, |
|
310
|
0 |
0 |
if( !isView ){ |
|
319
|
0 |
0 |
if( onError==OE_Replace ){ |
|
323
|
0 |
0 |
for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ |
|
324
|
0 |
0 |
if( pIdx->onError==OE_Replace ){ |
|
330
|
0 |
0 |
for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){ |
|
331
|
0 |
0 |
if( openAll || aIdxUsed[i] ){ |
|
|
0 |
0 |
if( openAll || aIdxUsed[i] ){ |
|
344
|
0 |
0 |
if( !row_triggers_exist ){ |
|
355
|
0 |
0 |
if( chngRecno ){ |
|
362
|
0 |
0 |
for(i=0; inCol; i++){ |
|
363
|
0 |
0 |
if( i==pTab->iPKey ){ |
|
368
|
0 |
0 |
if( j<0 ){ |
|
386
|
0 |
0 |
if( chngRecno ){ |
|
397
|
0 |
0 |
if( db->flags & SQLITE_CountRows && !pParse->trigStack){ |
|
|
0 |
0 |
if( db->flags & SQLITE_CountRows && !pParse->trigStack){ |
|
404
|
0 |
0 |
if( row_triggers_exist ){ |
|
405
|
0 |
0 |
if( !isView ){ |
|
406
|
0 |
0 |
for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){ |
|
407
|
0 |
0 |
if( openAll || aIdxUsed[i] ) |
|
|
0 |
0 |
if( openAll || aIdxUsed[i] ) |
|
413
|
0 |
0 |
if( sqliteCodeRowTrigger(pParse, TK_UPDATE, pChanges, TK_AFTER, pTab, |
|
427
|
0 |
0 |
if( !row_triggers_exist ){ |
|
428
|
0 |
0 |
for(i=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, i++){ |
|
429
|
0 |
0 |
if( openAll || aIdxUsed[i] ){ |
|
|
0 |
0 |
if( openAll || aIdxUsed[i] ){ |
|
446
|
0 |
0 |
if( db->flags & SQLITE_CountRows && !pParse->trigStack ){ |
|
|
0 |
0 |
if( db->flags & SQLITE_CountRows && !pParse->trigStack ){ |