Lines Matching refs:pTrigger
9415 Trigger *pTrigger; /* List of triggers stored in pSchema */
10246 ** TriggerPrg.pTrigger, assuming a default ON CONFLICT clause of
10249 ** values for both pTrigger and orconf.
10257 Trigger *pTrigger; /* Trigger this program was coded from */
10259 SubProgram *pProgram; /* Program implementing pTrigger/orconf */
10405 * linked list is stored as the "pTrigger" member of the associated
76885 Trigger *pTrigger;
76900 pTrigger = sqlite3TriggerList(pParse, pTab);
76901 while( pTrigger ){
76902 assert( pTrigger->pSchema==pTab->pSchema ||
76903 pTrigger->pSchema==db->aDb[1].pSchema );
76904 sqlite3DropTriggerPtr(pParse, pTrigger);
76905 pTrigger = pTrigger->pNext;
79234 Trigger *pTrigger; /* List of table triggers, if required */
79256 pTrigger = sqlite3TriggersExist(pParse, pTab, TK_DELETE, 0, 0);
79259 # define pTrigger 0
79273 if( sqlite3IsReadOnly(pParse, pTab, (pTrigger?1:0)) ){
79284 assert(!isView || pTrigger);
79340 if( rcauth==SQLITE_OK && pWhere==0 && !pTrigger && !IsVirtual(pTab)
79398 sqlite3GenerateRowDelete(pParse, pTab, iCur, iRowid, count, pTrigger, OE_Default);
79444 #ifdef pTrigger
79445 #undef pTrigger
79473 Trigger *pTrigger, /* List of triggers to (potentially) fire */
79491 if( sqlite3FkRequired(pParse, pTab, 0, 0) || pTrigger ){
79498 pParse, pTrigger, 0, 0, TRIGGER_BEFORE|TRIGGER_AFTER, pTab, onconf
79514 sqlite3CodeRowTrigger(pParse, pTrigger,
79547 sqlite3CodeRowTrigger(pParse, pTrigger,
82179 Trigger *pTrigger; /* Trigger definition to return */
82183 pTrigger = pFKey->apTrigger[iAction];
82185 if( action!=OE_None && !pTrigger ){
82298 pTrigger = (Trigger *)sqlite3DbMallocZero(db,
82303 if( pTrigger ){
82304 pStep = pTrigger->step_list = (TriggerStep *)&pTrigger[1];
82314 pTrigger->pWhen = sqlite3ExprDup(db, pWhen, EXPRDUP_REDUCE);
82326 fkTriggerDelete(db, pTrigger);
82342 pStep->pTrig = pTrigger;
82343 pTrigger->pSchema = pTab->pSchema;
82344 pTrigger->pTabSchema = pTab->pSchema;
82345 pFKey->apTrigger[iAction] = pTrigger;
82346 pTrigger->op = (pChanges ? TK_UPDATE : TK_DELETE);
82349 return pTrigger;
82895 Trigger *pTrigger; /* List of triggers on pTab, if required */
82926 pTrigger = sqlite3TriggersExist(pParse, pTab, TK_INSERT, 0, &tmask);
82929 # define pTrigger 0
82937 assert( (pTrigger && tmask) || (pTrigger==0 && tmask==0) );
82960 sqlite3BeginWriteOperation(pParse, pSelect || pTrigger, iDb);
82973 assert( !pTrigger );
83049 if( pTrigger || readsTable(pParse, addrSelect, iDb, pTab) ){
83291 sqlite3CodeRowTrigger(pParse, pTrigger, TK_INSERT, 0, TRIGGER_BEFORE,
83414 if( pTrigger ){
83416 sqlite3CodeRowTrigger(pParse, pTrigger, TK_INSERT, 0, TRIGGER_AFTER,
83475 #ifdef pTrigger
83476 #undef pTrigger
83702 Trigger *pTrigger = 0;
83704 pTrigger = sqlite3TriggersExist(pParse, pTab, TK_DELETE, 0, 0);
83706 if( pTrigger || sqlite3FkRequired(pParse, pTab, 0, 0) ){
83709 pParse, pTab, baseCur, regRowid, 0, pTrigger, OE_Replace
83813 Trigger *pTrigger = 0;
83817 pTrigger = sqlite3TriggersExist(pParse, pTab, TK_DELETE, 0, 0);
83820 pParse, pTab, baseCur, regR, 0, pTrigger, OE_Replace
92505 ** are already attached to pTab->pTrigger. But there might be additional
92507 ** TEMP triggers on pTab to the beginning of the pTab->pTrigger list
92512 ** pTab as well as the triggers lised in pTab->pTrigger.
92529 pTrig->pNext = (pList ? pList : pTab->pTrigger);
92535 return (pList ? pList : pTab->pTrigger);
92558 Trigger *pTrigger = 0; /* The new trigger */
92690 pTrigger = (Trigger*)sqlite3DbMallocZero(db, sizeof(Trigger));
92691 if( pTrigger==0 ) goto trigger_cleanup;
92692 pTrigger->zName = zName;
92694 pTrigger->table = sqlite3DbStrDup(db, pTableName->a[0].zName);
92695 pTrigger->pSchema = db->aDb[iDb].pSchema;
92696 pTrigger->pTabSchema = pTab->pSchema;
92697 pTrigger->op = (u8)op;
92698 pTrigger->tr_tm = tr_tm==TK_BEFORE ? TRIGGER_BEFORE : TRIGGER_AFTER;
92699 pTrigger->pWhen = sqlite3ExprDup(db, pWhen, EXPRDUP_REDUCE);
92700 pTrigger->pColumns = sqlite3IdListDup(db, pColumns);
92702 pParse->pNewTrigger = pTrigger;
92710 sqlite3DeleteTrigger(db, pTrigger);
92712 assert( pParse->pNewTrigger==pTrigger );
92783 pLink->pNext = pTab->pTrigger;
92784 pTab->pTrigger = pLink;
92921 SQLITE_PRIVATE void sqlite3DeleteTrigger(sqlite3 *db, Trigger *pTrigger){
92922 if( pTrigger==0 ) return;
92923 sqlite3DeleteTriggerStep(db, pTrigger->step_list);
92924 sqlite3DbFree(db, pTrigger->zName);
92925 sqlite3DbFree(db, pTrigger->table);
92926 sqlite3ExprDelete(db, pTrigger->pWhen);
92927 sqlite3IdListDelete(db, pTrigger->pColumns);
92928 sqlite3DbFree(db, pTrigger);
92940 Trigger *pTrigger = 0;
92959 pTrigger = sqlite3HashFind(&(db->aDb[j].pSchema->trigHash), zName, nName);
92960 if( pTrigger ) break;
92962 if( !pTrigger ){
92969 sqlite3DropTriggerPtr(pParse, pTrigger);
92979 static Table *tableOfTrigger(Trigger *pTrigger){
92980 int n = sqlite3Strlen30(pTrigger->table);
92981 return sqlite3HashFind(&pTrigger->pTabSchema->tblHash, pTrigger->table, n);
92988 SQLITE_PRIVATE void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger){
92994 iDb = sqlite3SchemaToIndex(pParse->db, pTrigger->pSchema);
92996 pTable = tableOfTrigger(pTrigger);
92998 assert( pTable->pSchema==pTrigger->pSchema || iDb==1 );
93005 if( sqlite3AuthCheck(pParse, code, pTrigger->zName, pTable->zName, zDb) ||
93032 sqlite3VdbeChangeP4(v, base+1, pTrigger->zName, 0);
93036 sqlite3VdbeAddOp4(v, OP_DropTrigger, iDb, 0, 0, pTrigger->zName, 0);
93048 Trigger *pTrigger;
93049 pTrigger = sqlite3HashInsert(pHash, zName, sqlite3Strlen30(zName), 0);
93050 if( ALWAYS(pTrigger) ){
93051 if( pTrigger->pSchema==pTrigger->pTabSchema ){
93052 Table *pTab = tableOfTrigger(pTrigger);
93054 for(pp=&pTab->pTrigger; *pp!=pTrigger; pp=&((*pp)->pNext));
93057 sqlite3DeleteTrigger(db, pTrigger);
93251 ** implementing trigger pTrigger with ON CONFLICT policy orconf.
93255 Trigger *pTrigger, /* Trigger to code */
93256 Table *pTab, /* The table pTrigger is attached to */
93269 assert( pTrigger->zName==0 || pTab==tableOfTrigger(pTrigger) );
93282 pPrg->pTrigger = pTrigger;
93296 pSubParse->zAuthContext = pTrigger->zName;
93297 pSubParse->eTriggerOp = pTrigger->op;
93303 pTrigger->zName, onErrorText(orconf),
93304 (pTrigger->tr_tm==TRIGGER_BEFORE ? "BEFORE" : "AFTER"),
93305 (pTrigger->op==TK_UPDATE ? "UPDATE" : ""),
93306 (pTrigger->op==TK_INSERT ? "INSERT" : ""),
93307 (pTrigger->op==TK_DELETE ? "DELETE" : ""),
93312 sqlite3MPrintf(db, "-- TRIGGER %s", pTrigger->zName), P4_DYNAMIC
93319 if( pTrigger->pWhen ){
93320 pWhen = sqlite3ExprDup(db, pTrigger->pWhen, 0);
93331 codeTriggerProgram(pSubParse, pTrigger->step_list, orconf);
93338 VdbeComment((v, "End: %s.%s", pTrigger->zName, onErrorText(orconf)));
93346 pProgram->token = (void *)pTrigger;
93361 ** trigger pTrigger with default ON CONFLICT algorithm orconf. If no such
93367 Trigger *pTrigger, /* Trigger to code */
93368 Table *pTab, /* The table trigger pTrigger is attached to */
93374 assert( pTrigger->zName==0 || pTab==tableOfTrigger(pTrigger) );
93378 ** a matching TriggerPrg.pTrigger field will be present somewhere
93381 pPrg && (pPrg->pTrigger!=pTrigger || pPrg->orconf!=orconf);
93387 pPrg = codeRowTrigger(pParse, pTrigger, pTab, orconf);
93473 Trigger *pTrigger, /* List of triggers on table pTab */
93482 Trigger *p; /* Used to iterate through pTrigger list */
93488 for(p=pTrigger; p; p=p->pNext){
93535 Trigger *pTrigger, /* List of triggers on table pTab */
93547 for(p=pTrigger; p; p=p->pNext){
93683 Trigger *pTrigger; /* List of triggers on pTab, if required */
93714 pTrigger = sqlite3TriggersExist(pParse, pTab, TK_UPDATE, pChanges, &tmask);
93716 assert( pTrigger || tmask==0 );
93718 # define pTrigger 0
93844 if( pTrigger || hasFK ){
93848 if( chngRowid || pTrigger || hasFK ){
93949 assert( chngRowid || pTrigger || hasFK || regOldRowid==regNewRowid );
93957 if( hasFK || pTrigger ){
93960 pTrigger, pChanges, 0, TRIGGER_BEFORE|TRIGGER_AFTER, pTab, onError
93988 pParse, pTrigger, pChanges, 1, TRIGGER_BEFORE, pTab, onError
94017 sqlite3CodeRowTrigger(pParse, pTrigger, TK_UPDATE, pChanges,
94084 sqlite3CodeRowTrigger(pParse, pTrigger, TK_UPDATE, pChanges,
94135 #ifdef pTrigger
94136 #undef pTrigger