Go to the source code of this file.
Functions | |
void | sqlite3DeleteTriggerStep (sqlite3 *db, TriggerStep *pTriggerStep) |
void | sqlite3BeginTrigger (Parse *pParse, Token *pName1, Token *pName2, int tr_tm, int op, IdList *pColumns, SrcList *pTableName, Expr *pWhen, int isTemp, int noErr) |
void | sqlite3FinishTrigger (Parse *pParse, TriggerStep *pStepList, Token *pAll) |
static void | sqlitePersistTriggerStep (sqlite3 *db, TriggerStep *p) |
TriggerStep * | sqlite3TriggerSelectStep (sqlite3 *db, Select *pSelect) |
TriggerStep * | sqlite3TriggerInsertStep (sqlite3 *db, Token *pTableName, IdList *pColumn, ExprList *pEList, Select *pSelect, int orconf) |
TriggerStep * | sqlite3TriggerUpdateStep (sqlite3 *db, Token *pTableName, ExprList *pEList, Expr *pWhere, int orconf) |
TriggerStep * | sqlite3TriggerDeleteStep (sqlite3 *db, Token *pTableName, Expr *pWhere) |
void | sqlite3DeleteTrigger (sqlite3 *db, Trigger *pTrigger) |
void | sqlite3DropTrigger (Parse *pParse, SrcList *pName, int noErr) |
static Table * | tableOfTrigger (Trigger *pTrigger) |
void | sqlite3DropTriggerPtr (Parse *pParse, Trigger *pTrigger) |
void | sqlite3UnlinkAndDeleteTrigger (sqlite3 *db, int iDb, const char *zName) |
static int | checkColumnOverLap (IdList *pIdList, ExprList *pEList) |
int | sqlite3TriggersExist (Parse *pParse, Table *pTab, int op, ExprList *pChanges) |
static SrcList * | targetSrcList (Parse *pParse, TriggerStep *pStep) |
static int | codeTriggerProgram (Parse *pParse, TriggerStep *pStepList, int orconfin) |
int | sqlite3CodeRowTrigger (Parse *pParse, int op, ExprList *pChanges, int tr_tm, Table *pTab, int newIdx, int oldIdx, int orconf, int ignoreJump, u32 *piOldColMask, u32 *piNewColMask) |
Definition at line 587 of file trigger.c.
References ExprList::a, ExprList::nExpr, sqlite3IdListIndex(), and ExprList::ExprList_item::zName.
Referenced by sqlite3CodeRowTrigger(), and sqlite3TriggersExist().
static int codeTriggerProgram | ( | Parse * | pParse, | |
TriggerStep * | pStepList, | |||
int | orconfin | |||
) | [static] |
Definition at line 658 of file trigger.c.
References Parse::db, db, Trigger::name, OE_Default, TriggerStep::op, OP_ContextPop, OP_ContextPush, OP_ResetCount, TriggerStack::orconf, TriggerStep::orconf, TriggerStep::pExprList, TriggerStep::pIdList, TriggerStep::pNext, TriggerStep::pSelect, TriggerStep::pTrig, Parse::pVdbe, TriggerStep::pWhere, sqlite3DeleteFrom(), sqlite3ExprDup(), sqlite3ExprListDup(), sqlite3IdListDup(), sqlite3Insert(), sqlite3Select(), sqlite3SelectDelete(), sqlite3SelectDestInit(), sqlite3SelectDup(), sqlite3Update(), sqlite3VdbeAddOp2(), SRT_Discard, targetSrcList(), TK_DELETE, TK_INSERT, TK_SELECT, TK_UPDATE, Parse::trigStack, and VdbeComment.
Referenced by sqlite3CodeRowTrigger().
void sqlite3BeginTrigger | ( | Parse * | pParse, | |
Token * | pName1, | |||
Token * | pName2, | |||
int | tr_tm, | |||
int | op, | |||
IdList * | pColumns, | |||
SrcList * | pTableName, | |||
Expr * | pWhen, | |||
int | isTemp, | |||
int | noErr | |||
) |
Definition at line 44 of file trigger.c.
References SrcList::a, sqlite3::aDb, Parse::db, db, IsVirtual, sqlite3::mallocFailed, Token::n, Trigger::name, Trigger::nameToken, Parse::nErr, SrcList::nSrc, Trigger::op, Trigger::pColumns, Parse::pNewTrigger, Trigger::pSchema, Db::pSchema, Table::pSchema, Table::pSelect, Trigger::pTabSchema, Trigger::pWhen, SCHEMA_TABLE, sqlite3AuthCheck(), sqlite3CheckObjectName(), sqlite3DbFree(), sqlite3DbMallocZero(), sqlite3DbStrDup(), sqlite3DeleteTrigger(), sqlite3ErrorMsg(), sqlite3ExprDelete(), sqlite3ExprDup(), sqlite3FixInit(), sqlite3FixSrcList(), sqlite3HashFind(), sqlite3IdListDelete(), sqlite3IdListDup(), sqlite3NameFromToken(), sqlite3SchemaToIndex(), sqlite3SrcListDelete(), sqlite3SrcListLookup(), sqlite3StrNICmp(), sqlite3TokenCopy(), sqlite3TwoPartName(), SQLITE_CREATE_TEMP_TRIGGER, SQLITE_CREATE_TRIGGER, SQLITE_INSERT, SQLITE_OK, Trigger::table, TK_BEFORE, TK_INSTEAD, Trigger::tr_tm, TRIGGER_AFTER, TRIGGER_BEFORE, Schema::trigHash, SrcList::SrcList_item::zName, Db::zName, and Table::zName.
Referenced by yy_reduce().
int sqlite3CodeRowTrigger | ( | Parse * | pParse, | |
int | op, | |||
ExprList * | pChanges, | |||
int | tr_tm, | |||
Table * | pTab, | |||
int | newIdx, | |||
int | oldIdx, | |||
int | orconf, | |||
int | ignoreJump, | |||
u32 * | piOldColMask, | |||
u32 * | piNewColMask | |||
) |
Definition at line 755 of file trigger.c.
References sqlite3::aDb, checkColumnOverLap(), codeTriggerProgram(), Parse::db, db, TriggerStack::ignoreJump, sqlite3::mallocFailed, Trigger::name, TriggerStack::newColMask, TriggerStack::newIdx, TriggerStack::oldColMask, TriggerStack::oldIdx, Trigger::op, OP_Trace, P4_DYNAMIC, Trigger::pColumns, TriggerStack::pNext, Trigger::pNext, NameContext::pParse, Db::pSchema, Trigger::pSchema, TriggerStack::pTab, Trigger::pTabSchema, TriggerStack::pTrigger, Table::pTrigger, Parse::pVdbe, Trigger::pWhen, sqlite3AuthContextPop(), sqlite3AuthContextPush(), sqlite3ErrorMsg(), sqlite3ExprDelete(), sqlite3ExprDup(), sqlite3ExprIfFalse(), sqlite3MPrintf(), sqlite3ResolveExprNames(), sqlite3VdbeAddOp4(), sqlite3VdbeMakeLabel(), sqlite3VdbeResolveLabel(), SQLITE_ERROR, SQLITE_JUMPIFNULL, Trigger::step_list, TK_DELETE, TK_INSERT, TK_UPDATE, Trigger::tr_tm, TRIGGER_AFTER, TRIGGER_BEFORE, and Parse::trigStack.
Referenced by sqlite3DeleteFrom(), sqlite3Insert(), and sqlite3Update().
Definition at line 430 of file trigger.c.
References Token::dyn, Trigger::name, Trigger::nameToken, Trigger::pColumns, Trigger::pWhen, sqlite3DbFree(), sqlite3DeleteTriggerStep(), sqlite3ExprDelete(), sqlite3IdListDelete(), Trigger::step_list, Trigger::table, and Token::z.
Referenced by sqlite3BeginTrigger(), sqlite3FinishTrigger(), sqlite3RunParser(), sqlite3SchemaFree(), and sqlite3UnlinkAndDeleteTrigger().
void sqlite3DeleteTriggerStep | ( | sqlite3 * | db, | |
TriggerStep * | pTriggerStep | |||
) |
Definition at line 21 of file trigger.c.
References Token::dyn, TriggerStep::pExprList, TriggerStep::pIdList, TriggerStep::pNext, TriggerStep::pSelect, TriggerStep::pWhere, sqlite3DbFree(), sqlite3ExprDelete(), sqlite3ExprListDelete(), sqlite3IdListDelete(), sqlite3SelectDelete(), TriggerStep::target, and Token::z.
Referenced by sqlite3DeleteTrigger(), sqlite3FinishTrigger(), and yy_destructor().
Definition at line 449 of file trigger.c.
References SrcList::a, sqlite3::aDb, Parse::db, db, sqlite3::mallocFailed, sqlite3::nDb, SrcList::nSrc, OMIT_TEMPDB, Db::pSchema, sqlite3DropTriggerPtr(), sqlite3ErrorMsg(), sqlite3HashFind(), sqlite3ReadSchema(), sqlite3SrcListDelete(), sqlite3StrICmp(), SQLITE_OK, Schema::trigHash, SrcList::SrcList_item::zDatabase, Db::zName, and SrcList::SrcList_item::zName.
Referenced by yy_reduce().
Definition at line 497 of file trigger.c.
References sqlite3::aDb, ADDR, ArraySize, Parse::db, db, Trigger::name, OP_Close, OP_Column, OP_Delete, OP_DropTrigger, OP_Ne, OP_Next, OP_Rewind, OP_String8, P4_STATIC, Table::pSchema, Trigger::pSchema, SCHEMA_TABLE, sqlite3AuthCheck(), sqlite3BeginWriteOperation(), sqlite3ChangeCookie(), sqlite3GetVdbe(), sqlite3OpenMasterTable(), sqlite3SchemaToIndex(), sqlite3VdbeAddOp2(), sqlite3VdbeAddOp4(), sqlite3VdbeAddOpList(), sqlite3VdbeChangeP4(), SQLITE_DELETE, SQLITE_DROP_TEMP_TRIGGER, SQLITE_DROP_TRIGGER, tableOfTrigger(), Table::zName, and Db::zName.
Referenced by sqlite3DropTable(), and sqlite3DropTrigger().
void sqlite3FinishTrigger | ( | Parse * | pParse, | |
TriggerStep * | pStepList, | |||
Token * | pAll | |||
) |
Definition at line 204 of file trigger.c.
References sqlite3::aDb, sqlite3::sqlite3InitInfo::busy, Parse::db, db, sqlite3::init, sqlite3::mallocFailed, Token::n, Trigger::name, Trigger::nameToken, Parse::nErr, OP_ParseSchema, P4_DYNAMIC, Parse::pNewTrigger, Trigger::pNext, TriggerStep::pNext, Db::pSchema, Trigger::pSchema, Trigger::pTabSchema, TriggerStep::pTrig, Table::pTrigger, SCHEMA_TABLE, sqlite3BeginWriteOperation(), sqlite3ChangeCookie(), sqlite3DbFree(), sqlite3DbStrNDup(), sqlite3DeleteTrigger(), sqlite3DeleteTriggerStep(), sqlite3FixInit(), sqlite3FixTriggerStep(), sqlite3GetVdbe(), sqlite3HashFind(), sqlite3HashInsert(), sqlite3MPrintf(), sqlite3NestedParse(), sqlite3SchemaToIndex(), sqlite3VdbeAddOp4(), Trigger::step_list, Trigger::table, Schema::tblHash, Schema::trigHash, Token::z, and Db::zName.
Referenced by yy_reduce().
TriggerStep* sqlite3TriggerDeleteStep | ( | sqlite3 * | db, | |
Token * | pTableName, | |||
Expr * | pWhere | |||
) |
Definition at line 407 of file trigger.c.
References OE_Default, TriggerStep::op, TriggerStep::orconf, TriggerStep::pWhere, sqlite3DbMallocZero(), sqlite3ExprDelete(), sqlitePersistTriggerStep(), TriggerStep::target, and TK_DELETE.
Referenced by yy_reduce().
TriggerStep* sqlite3TriggerInsertStep | ( | sqlite3 * | db, | |
Token * | pTableName, | |||
IdList * | pColumn, | |||
ExprList * | pEList, | |||
Select * | pSelect, | |||
int | orconf | |||
) |
Definition at line 342 of file trigger.c.
References sqlite3::mallocFailed, TriggerStep::op, TriggerStep::orconf, TriggerStep::pExprList, TriggerStep::pIdList, TriggerStep::pSelect, sqlite3DbMallocZero(), sqlite3ExprListDelete(), sqlite3IdListDelete(), sqlite3SelectDelete(), sqlitePersistTriggerStep(), TriggerStep::target, and TK_INSERT.
Referenced by yy_reduce().
TriggerStep* sqlite3TriggerSelectStep | ( | sqlite3 * | db, | |
Select * | pSelect | |||
) |
Definition at line 320 of file trigger.c.
References OE_Default, TriggerStep::op, TriggerStep::orconf, TriggerStep::pSelect, sqlite3DbMallocZero(), sqlite3SelectDelete(), sqlitePersistTriggerStep(), and TK_SELECT.
Referenced by yy_reduce().
Definition at line 605 of file trigger.c.
References checkColumnOverLap(), IsVirtual, Trigger::op, Trigger::pColumns, Trigger::pNext, Table::pTrigger, and Trigger::tr_tm.
Referenced by sqlite3DeleteFrom(), sqlite3Insert(), and sqlite3Update().
TriggerStep* sqlite3TriggerUpdateStep | ( | sqlite3 * | db, | |
Token * | pTableName, | |||
ExprList * | pEList, | |||
Expr * | pWhere, | |||
int | orconf | |||
) |
Definition at line 378 of file trigger.c.
References TriggerStep::op, TriggerStep::orconf, TriggerStep::pExprList, TriggerStep::pWhere, sqlite3DbMallocZero(), sqlite3ExprDelete(), sqlite3ExprListDelete(), sqlitePersistTriggerStep(), TriggerStep::target, and TK_UPDATE.
Referenced by yy_reduce().
void sqlite3UnlinkAndDeleteTrigger | ( | sqlite3 * | db, | |
int | iDb, | |||
const char * | zName | |||
) |
Definition at line 552 of file trigger.c.
References sqlite3::aDb, sqlite3::flags, Trigger::pNext, Db::pSchema, Table::pTrigger, sqlite3DeleteTrigger(), sqlite3HashInsert(), SQLITE_InternChanges, tableOfTrigger(), and Schema::trigHash.
Referenced by sqlite3VdbeExec().
static void sqlitePersistTriggerStep | ( | sqlite3 * | db, | |
TriggerStep * | p | |||
) | [static] |
Definition at line 286 of file trigger.c.
References Token::dyn, Token::n, TriggerStep::pExprList, TriggerStep::pIdList, TriggerStep::pSelect, TriggerStep::pWhere, sqlite3DbStrNDup(), sqlite3ExprDelete(), sqlite3ExprDup(), sqlite3ExprListDelete(), sqlite3ExprListDup(), sqlite3IdListDelete(), sqlite3IdListDup(), sqlite3SelectDelete(), sqlite3SelectDup(), TriggerStep::target, and Token::z.
Referenced by sqlite3TriggerDeleteStep(), sqlite3TriggerInsertStep(), sqlite3TriggerSelectStep(), and sqlite3TriggerUpdateStep().
Definition at line 488 of file trigger.c.
References Trigger::pTabSchema, sqlite3HashFind(), Trigger::table, and Schema::tblHash.
Referenced by sqlite3DropTriggerPtr(), and sqlite3UnlinkAndDeleteTrigger().
static SrcList* targetSrcList | ( | Parse * | pParse, | |
TriggerStep * | pStep | |||
) | [static] |
Definition at line 634 of file trigger.c.
References sqlite3::aDb, db, Parse::db, Token::n, sqlite3::nDb, Trigger::pSchema, TriggerStep::pTrig, sqlite3SchemaToIndex(), sqlite3SrcListAppend(), TriggerStep::target, Token::z, and Db::zName.
Referenced by codeTriggerProgram().
ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:50:02 2011 by Doxygen 1.6.1