line |
true |
false |
branch |
19
|
0 |
0 |
while( pTriggerStep ){ |
23
|
0 |
0 |
if( pTmp->target.dyn ) sqliteFree((char*)pTmp->target.z); |
66
|
0 |
0 |
if( sqlite_malloc_failed ) goto trigger_cleanup; |
68
|
0 |
0 |
if( db->init.busy |
69
|
0 |
0 |
&& sqliteFixInit(&sFix, pParse, db->init.iDb, "trigger", pName) |
70
|
0 |
0 |
&& sqliteFixSrcList(&sFix, pTableName) |
75
|
0 |
0 |
if( !tab ){ |
78
|
0 |
0 |
iDb = isTemp ? 1 : tab->iDb; |
79
|
0 |
0 |
if( iDb>=2 && !db->init.busy ){ |
|
0 |
0 |
if( iDb>=2 && !db->init.busy ){ |
87
|
0 |
0 |
if( sqliteHashFind(&(db->aDb[iDb].trigHash), zName,pName->n+1) ){ |
91
|
0 |
0 |
if( sqliteStrNICmp(tab->zName, "sqlite_", 7)==0 ){ |
96
|
0 |
0 |
if( tab->pSelect && tr_tm != TK_INSTEAD ){ |
|
0 |
0 |
if( tab->pSelect && tr_tm != TK_INSTEAD ){ |
97
|
0 |
0 |
sqliteErrorMsg(pParse, "cannot create %s trigger on view: %S", |
101
|
0 |
0 |
if( !tab->pSelect && tr_tm == TK_INSTEAD ){ |
|
0 |
0 |
if( !tab->pSelect && tr_tm == TK_INSTEAD ){ |
110
|
0 |
0 |
const char *zDbTrig = isTemp ? db->aDb[1].zName : zDb; |
111
|
0 |
0 |
if( tab->iDb==1 || isTemp ) code = SQLITE_CREATE_TEMP_TRIGGER; |
|
0 |
0 |
if( tab->iDb==1 || isTemp ) code = SQLITE_CREATE_TEMP_TRIGGER; |
112
|
0 |
0 |
if( sqliteAuthCheck(pParse, code, zName, tab->zName, zDbTrig) ){ |
115
|
0 |
0 |
if( sqliteAuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(tab->iDb), 0, zDb)){ |
|
0 |
0 |
if( sqliteAuthCheck(pParse, SQLITE_INSERT, SCHEMA_TABLE(tab->iDb), 0, zDb)){ |
126
|
0 |
0 |
if (tr_tm == TK_INSTEAD){ |
132
|
0 |
0 |
if( nt==0 ) goto trigger_cleanup; |
136
|
0 |
0 |
if( sqlite_malloc_failed ) goto trigger_cleanup; |
168
|
0 |
0 |
if( pParse->nErr || pParse->pNewTrigger==0 ) goto triggerfinish_cleanup; |
|
0 |
0 |
if( pParse->nErr || pParse->pNewTrigger==0 ) goto triggerfinish_cleanup; |
172
|
0 |
0 |
while( pStepList ){ |
176
|
0 |
0 |
if( sqliteFixInit(&sFix, pParse, nt->iDb, "trigger", &nt->nameToken) |
177
|
0 |
0 |
&& sqliteFixTriggerStep(&sFix, nt->step_list) ){ |
184
|
0 |
0 |
if( !db->init.busy ){ |
200
|
0 |
0 |
if( v==0 ) goto triggerfinish_cleanup; |
207
|
0 |
0 |
if( nt->iDb==0 ){ |
214
|
0 |
0 |
if( !pParse->explain ){ |
243
|
0 |
0 |
if( p->target.z ){ |
247
|
0 |
0 |
if( p->pSelect ){ |
252
|
0 |
0 |
if( p->pWhere ){ |
257
|
0 |
0 |
if( p->pExprList ){ |
262
|
0 |
0 |
if( p->pIdList ){ |
278
|
0 |
0 |
if( pTriggerStep==0 ) return 0; |
303
|
0 |
0 |
if( pTriggerStep==0 ) return 0; |
331
|
0 |
0 |
if( pTriggerStep==0 ) return 0; |
350
|
0 |
0 |
if( pTriggerStep==0 ) return 0; |
365
|
0 |
0 |
if( pTrigger==0 ) return; |
371
|
0 |
0 |
if( pTrigger->nameToken.dyn ) sqliteFree((char*)pTrigger->nameToken.z); |
396
|
0 |
0 |
if( sqlite_malloc_failed ) goto drop_trigger_cleanup; |
401
|
0 |
0 |
for(i=0; inDb; i++){ |
402
|
0 |
0 |
int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ |
403
|
0 |
0 |
if( zDb && sqliteStrICmp(db->aDb[j].zName, zDb) ) continue; |
|
0 |
0 |
if( zDb && sqliteStrICmp(db->aDb[j].zName, zDb) ) continue; |
405
|
0 |
0 |
if( pTrigger ) break; |
407
|
0 |
0 |
if( !pTrigger ){ |
428
|
0 |
0 |
if( pTrigger->iDb>=2 ){ |
440
|
0 |
0 |
const char *zTab = SCHEMA_TABLE(pTrigger->iDb); |
441
|
0 |
0 |
if( pTrigger->iDb ) code = SQLITE_DROP_TEMP_TRIGGER; |
451
|
0 |
0 |
if( pTable!=0 && !nested && (v = sqliteGetVdbe(pParse))!=0 ){ |
|
0 |
0 |
if( pTable!=0 && !nested && (v = sqliteGetVdbe(pParse))!=0 ){ |
|
0 |
0 |
if( pTable!=0 && !nested && (v = sqliteGetVdbe(pParse))!=0 ){ |
469
|
0 |
0 |
if( pTrigger->iDb==0 ){ |
479
|
0 |
0 |
if( !pParse->explain ){ |
482
|
0 |
0 |
if( pTable->pTrigger == pTrigger ){ |
486
|
0 |
0 |
while( cc ){ |
487
|
0 |
0 |
if( cc->pNext == pTrigger ){ |
511
|
0 |
0 |
if( !pIdList || !pEList ) return 1; |
|
0 |
0 |
if( !pIdList || !pEList ) return 1; |
512
|
0 |
0 |
for(e=0; enExpr; e++){ |
513
|
0 |
0 |
if( sqliteIdListIndex(pIdList, pEList->a[e].zName)>=0 ) return 1; |
543
|
0 |
100 |
if( always_code_trigger_setup ){ |
548
|
0 |
100 |
while( pTriggerCursor ){ |
549
|
0 |
0 |
if( pTriggerCursor->op == op && |
|
0 |
0 |
if( pTriggerCursor->op == op && |
550
|
0 |
0 |
pTriggerCursor->tr_tm == tr_tm && |
551
|
0 |
0 |
pTriggerCursor->foreach == foreach && |
555
|
0 |
0 |
while( ss && ss->pTrigger != pTrigger ){ |
|
0 |
0 |
while( ss && ss->pTrigger != pTrigger ){ |
558
|
0 |
0 |
if( !ss )return 1; |
585
|
0 |
0 |
if( iDb==0 || iDb>=2 ){ |
|
0 |
0 |
if( iDb==0 || iDb>=2 ){ |
608
|
0 |
0 |
while( pTriggerStep ){ |
611
|
0 |
0 |
orconf = (orconfin == OE_Default)?pTriggerStep->orconf:orconfin; |
699
|
0 |
0 |
while( pTrigger ){ |
703
|
0 |
0 |
if( pTrigger->op == op && pTrigger->tr_tm == tr_tm && |
|
0 |
0 |
if( pTrigger->op == op && pTrigger->tr_tm == tr_tm && |
|
0 |
0 |
if( pTrigger->op == op && pTrigger->tr_tm == tr_tm && |
707
|
0 |
0 |
while( pTriggerStack ){ |
708
|
0 |
0 |
if( pTriggerStack->pTrigger == pTrigger ){ |
713
|
0 |
0 |
if( op == TK_UPDATE && pTrigger->pColumns && |
719
|
0 |
0 |
if( fire_this && (pTriggerStack = sqliteMalloc(sizeof(TriggerStack)))!=0 ){ |
|
0 |
0 |
if( fire_this && (pTriggerStack = sqliteMalloc(sizeof(TriggerStack)))!=0 ){ |
740
|
0 |
0 |
if( sqliteExprResolveIds(pParse, &dummyTablist, 0, whenExpr) ){ |