1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-06 15:49:35 +03:00

All tests pass even if OMIT_TRIGGER is defined. (CVS 2053)

FossilOrigin-Name: c33b3a613751057e8a46fdcd428b8448329d414d
This commit is contained in:
drh
2004-11-04 04:42:28 +00:00
parent bf8aa33bba
commit 798da52ce7
20 changed files with 349 additions and 261 deletions

View File

@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle DELETE FROM statements.
**
** $Id: delete.c,v 1.84 2004/10/31 02:22:49 drh Exp $
** $Id: delete.c,v 1.85 2004/11/04 04:42:28 drh Exp $
*/
#include "sqliteInt.h"
@@ -81,13 +81,15 @@ void sqlite3DeleteFrom(
Index *pIdx; /* For looping over indices of the table */
int iCur; /* VDBE Cursor number for pTab */
sqlite3 *db; /* Main database structure */
int isView; /* True if attempting to delete from a view */
AuthContext sContext; /* Authorization context */
int oldIdx = -1; /* Cursor for the OLD table of AFTER triggers */
#ifndef SQLITE_OMIT_TRIGGER
int isView; /* True if attempting to delete from a view */
int row_triggers_exist = 0; /* True if any triggers exist */
int before_triggers; /* True if there are BEFORE triggers */
int after_triggers; /* True if there are AFTER triggers */
int oldIdx = -1; /* Cursor for the OLD table of AFTER triggers */
#endif
sContext.pParse = 0;
if( pParse->nErr || sqlite3_malloc_failed ){
@@ -271,7 +273,7 @@ void sqlite3DeleteFrom(
sqlite3VdbeAddOp(v, OP_Close, iCur, 0);
}
sqlite3CodeRowTrigger(pParse, TK_DELETE, 0, TK_BEFORE, pTab, -1,
(void)sqlite3CodeRowTrigger(pParse, TK_DELETE, 0, TK_BEFORE, pTab, -1,
oldIdx, (pParse->trigStack)?pParse->trigStack->orconf:OE_Default,
addr);
}
@@ -305,7 +307,7 @@ void sqlite3DeleteFrom(
}
sqlite3VdbeAddOp(v, OP_Close, iCur, 0);
}
sqlite3CodeRowTrigger(pParse, TK_DELETE, 0, TK_AFTER, pTab, -1,
(void)sqlite3CodeRowTrigger(pParse, TK_DELETE, 0, TK_AFTER, pTab, -1,
oldIdx, (pParse->trigStack)?pParse->trigStack->orconf:OE_Default,
addr);
}