• Home
  • Raw
  • Download

Lines Matching refs:pTrigger

10968   Trigger *pTrigger;   /* List of triggers stored in pSchema */  member
11866 Trigger *pTrigger; /* Trigger this program was coded from */ member
88468 Trigger *pTrigger;
88485 pTrigger = sqlite3TriggerList(pParse, pTab);
88486 while( pTrigger ){
88487 assert( pTrigger->pSchema==pTab->pSchema ||
88488 pTrigger->pSchema==db->aDb[1].pSchema );
88489 sqlite3DropTriggerPtr(pParse, pTrigger);
88490 pTrigger = pTrigger->pNext;
91135 Trigger *pTrigger; /* List of table triggers, if required */
91157 pTrigger = sqlite3TriggersExist(pParse, pTab, TK_DELETE, 0, 0);
91160 # define pTrigger 0
91174 if( sqlite3IsReadOnly(pParse, pTab, (pTrigger?1:0)) ){
91185 assert(!isView || pTrigger);
91242 if( rcauth==SQLITE_OK && pWhere==0 && !pTrigger && !IsVirtual(pTab)
91388 sqlite3GenerateRowDelete(pParse, pTab, pTrigger, iDataCur, iIdxCur,
91443 #ifdef pTrigger
91444 #undef pTrigger
91470 Trigger *pTrigger, /* List of triggers to (potentially) fire */
91502 if( sqlite3FkRequired(pParse, pTab, 0, 0) || pTrigger ){
91510 pParse, pTrigger, 0, 0, TRIGGER_BEFORE|TRIGGER_AFTER, pTab, onconf
91529 sqlite3CodeRowTrigger(pParse, pTrigger,
91567 sqlite3CodeRowTrigger(pParse, pTrigger,
94585 Trigger *pTrigger; /* Trigger definition to return */
94589 pTrigger = pFKey->apTrigger[iAction];
94591 if( action!=OE_None && !pTrigger ){
94704 pTrigger = (Trigger *)sqlite3DbMallocZero(db,
94709 if( pTrigger ){
94710 pStep = pTrigger->step_list = (TriggerStep *)&pTrigger[1];
94719 pTrigger->pWhen = sqlite3ExprDup(db, pWhen, EXPRDUP_REDUCE);
94731 fkTriggerDelete(db, pTrigger);
94748 pStep->pTrig = pTrigger;
94749 pTrigger->pSchema = pTab->pSchema;
94750 pTrigger->pTabSchema = pTab->pSchema;
94751 pFKey->apTrigger[iAction] = pTrigger;
94752 pTrigger->op = (pChanges ? TK_UPDATE : TK_DELETE);
94755 return pTrigger;
95311 Trigger *pTrigger; /* List of triggers on pTab, if required */
95354 pTrigger = sqlite3TriggersExist(pParse, pTab, TK_INSERT, 0, &tmask);
95357 # define pTrigger 0
95365 assert( (pTrigger && tmask) || (pTrigger==0 && tmask==0) );
95385 sqlite3BeginWriteOperation(pParse, pSelect || pTrigger, iDb);
95398 assert( !pTrigger );
95495 if( pTrigger || readsTable(pParse, iDb, pTab) ){
95682 sqlite3CodeRowTrigger(pParse, pTrigger, TK_INSERT, 0, TRIGGER_BEFORE,
95806 if( pTrigger ){
95808 sqlite3CodeRowTrigger(pParse, pTrigger, TK_INSERT, 0, TRIGGER_AFTER,
95867 #ifdef pTrigger
95868 #undef pTrigger
96159 Trigger *pTrigger = 0;
96161 pTrigger = sqlite3TriggersExist(pParse, pTab, TK_DELETE, 0, 0);
96163 if( pTrigger || sqlite3FkRequired(pParse, pTab, 0, 0) ){
96165 sqlite3GenerateRowDelete(pParse, pTab, pTrigger, iDataCur, iIdxCur,
96333 Trigger *pTrigger = 0;
96337 pTrigger = sqlite3TriggersExist(pParse, pTab, TK_DELETE, 0, 0);
96339 sqlite3GenerateRowDelete(pParse, pTab, pTrigger, iDataCur, iIdxCur,
107168 pTrig->pNext = (pList ? pList : pTab->pTrigger);
107174 return (pList ? pList : pTab->pTrigger);
107197 Trigger *pTrigger = 0; /* The new trigger */
107346 pTrigger = (Trigger*)sqlite3DbMallocZero(db, sizeof(Trigger));
107347 if( pTrigger==0 ) goto trigger_cleanup;
107348 pTrigger->zName = zName;
107350 pTrigger->table = sqlite3DbStrDup(db, pTableName->a[0].zName);
107351 pTrigger->pSchema = db->aDb[iDb].pSchema;
107352 pTrigger->pTabSchema = pTab->pSchema;
107353 pTrigger->op = (u8)op;
107354 pTrigger->tr_tm = tr_tm==TK_BEFORE ? TRIGGER_BEFORE : TRIGGER_AFTER;
107355 pTrigger->pWhen = sqlite3ExprDup(db, pWhen, EXPRDUP_REDUCE);
107356 pTrigger->pColumns = sqlite3IdListDup(db, pColumns);
107358 pParse->pNewTrigger = pTrigger;
107366 sqlite3DeleteTrigger(db, pTrigger);
107368 assert( pParse->pNewTrigger==pTrigger );
107440 pLink->pNext = pTab->pTrigger;
107441 pTab->pTrigger = pLink;
107574 SQLITE_PRIVATE void sqlite3DeleteTrigger(sqlite3 *db, Trigger *pTrigger){
107575 if( pTrigger==0 ) return;
107576 sqlite3DeleteTriggerStep(db, pTrigger->step_list);
107577 sqlite3DbFree(db, pTrigger->zName);
107578 sqlite3DbFree(db, pTrigger->table);
107579 sqlite3ExprDelete(db, pTrigger->pWhen);
107580 sqlite3IdListDelete(db, pTrigger->pColumns);
107581 sqlite3DbFree(db, pTrigger);
107593 Trigger *pTrigger = 0;
107614 pTrigger = sqlite3HashFind(&(db->aDb[j].pSchema->trigHash), zName, nName);
107615 if( pTrigger ) break;
107617 if( !pTrigger ){
107626 sqlite3DropTriggerPtr(pParse, pTrigger);
107636 static Table *tableOfTrigger(Trigger *pTrigger){
107637 int n = sqlite3Strlen30(pTrigger->table);
107638 return sqlite3HashFind(&pTrigger->pTabSchema->tblHash, pTrigger->table, n);
107645 SQLITE_PRIVATE void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger){
107651 iDb = sqlite3SchemaToIndex(pParse->db, pTrigger->pSchema);
107653 pTable = tableOfTrigger(pTrigger);
107655 assert( pTable->pSchema==pTrigger->pSchema || iDb==1 );
107662 if( sqlite3AuthCheck(pParse, code, pTrigger->zName, pTable->zName, zDb) ||
107690 sqlite3VdbeChangeP4(v, base+1, pTrigger->zName, P4_TRANSIENT);
107694 sqlite3VdbeAddOp4(v, OP_DropTrigger, iDb, 0, 0, pTrigger->zName, 0);
107705 Trigger *pTrigger;
107710 pTrigger = sqlite3HashInsert(pHash, zName, sqlite3Strlen30(zName), 0);
107711 if( ALWAYS(pTrigger) ){
107712 if( pTrigger->pSchema==pTrigger->pTabSchema ){
107713 Table *pTab = tableOfTrigger(pTrigger);
107715 for(pp=&pTab->pTrigger; *pp!=pTrigger; pp=&((*pp)->pNext));
107718 sqlite3DeleteTrigger(db, pTrigger);
107920 Trigger *pTrigger, /* Trigger to code */
107934 assert( pTrigger->zName==0 || pTab==tableOfTrigger(pTrigger) );
107947 pPrg->pTrigger = pTrigger;
107961 pSubParse->zAuthContext = pTrigger->zName;
107962 pSubParse->eTriggerOp = pTrigger->op;
107968 pTrigger->zName, onErrorText(orconf),
107969 (pTrigger->tr_tm==TRIGGER_BEFORE ? "BEFORE" : "AFTER"),
107970 (pTrigger->op==TK_UPDATE ? "UPDATE" : ""),
107971 (pTrigger->op==TK_INSERT ? "INSERT" : ""),
107972 (pTrigger->op==TK_DELETE ? "DELETE" : ""),
107977 sqlite3MPrintf(db, "-- TRIGGER %s", pTrigger->zName), P4_DYNAMIC
107984 if( pTrigger->pWhen ){
107985 pWhen = sqlite3ExprDup(db, pTrigger->pWhen, 0);
107996 codeTriggerProgram(pSubParse, pTrigger->step_list, orconf);
108003 VdbeComment((v, "End: %s.%s", pTrigger->zName, onErrorText(orconf)));
108012 pProgram->token = (void *)pTrigger;
108034 Trigger *pTrigger, /* Trigger to code */
108041 assert( pTrigger->zName==0 || pTab==tableOfTrigger(pTrigger) );
108048 pPrg && (pPrg->pTrigger!=pTrigger || pPrg->orconf!=orconf);
108054 pPrg = codeRowTrigger(pParse, pTrigger, pTab, orconf);
108140 Trigger *pTrigger, /* List of triggers on table pTab */
108155 for(p=pTrigger; p; p=p->pNext){
108202 Trigger *pTrigger, /* List of triggers on table pTab */
108214 for(p=pTrigger; p; p=p->pNext){
108358 Trigger *pTrigger; /* List of triggers on pTab, if required */
108392 pTrigger = sqlite3TriggersExist(pParse, pTab, TK_UPDATE, pChanges, &tmask);
108394 assert( pTrigger || tmask==0 );
108396 # define pTrigger 0
108545 if( chngPk || pTrigger || hasFK ){
108549 if( chngKey || pTrigger || hasFK ){
108692 assert( chngKey || pTrigger || hasFK || regOldRowid==regNewRowid );
108700 if( chngPk || hasFK || pTrigger ){
108703 pTrigger, pChanges, 0, TRIGGER_BEFORE|TRIGGER_AFTER, pTab, onError
108735 pParse, pTrigger, pChanges, 1, TRIGGER_BEFORE, pTab, onError
108765 sqlite3CodeRowTrigger(pParse, pTrigger, TK_UPDATE, pChanges,
108849 sqlite3CodeRowTrigger(pParse, pTrigger, TK_UPDATE, pChanges,
108907 #ifdef pTrigger
108908 #undef pTrigger