aboutsummaryrefslogtreecommitdiff
path: root/src/insert.c
diff options
context:
space:
mode:
authordanielk1977 <danielk1977@noemail.net>2002-06-11 02:25:40 +0000
committerdanielk1977 <danielk1977@noemail.net>2002-06-11 02:25:40 +0000
commit6f34903e85f22edca3b3ac7649182fafea0643cb (patch)
treec92d0d3b3ea651835a4dba4bc64099308b6e9e88 /src/insert.c
parent28f4b6885b32acda86b6d014430b246ad20c4336 (diff)
downloadsqlite-6f34903e85f22edca3b3ac7649182fafea0643cb.tar.gz
sqlite-6f34903e85f22edca3b3ac7649182fafea0643cb.zip
Add RAISE() function, which allows more advanced flow-control in trigger programs (ticket #55) (CVS 614)
FossilOrigin-Name: d4a2fb10067203a0d49317db747759872e62927e
Diffstat (limited to 'src/insert.c')
-rw-r--r--src/insert.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/insert.c b/src/insert.c
index 7032da349..73ed0563a 100644
--- a/src/insert.c
+++ b/src/insert.c
@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle INSERT statements in SQLite.
**
-** $Id: insert.c,v 1.60 2002/06/06 18:54:40 drh Exp $
+** $Id: insert.c,v 1.61 2002/06/11 02:25:42 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -235,6 +235,7 @@ void sqliteInsert(
iCont = sqliteVdbeCurrentAddr(v);
}
+ endOfLoop = sqliteVdbeMakeLabel(v);
if( row_triggers_exist ){
/* build the new.* reference row */
@@ -262,7 +263,7 @@ void sqliteInsert(
/* Fire BEFORE triggers */
if( sqliteCodeRowTrigger(pParse, TK_INSERT, 0, TK_BEFORE, pTab, newIdx, -1,
- onError) ){
+ onError, endOfLoop) ){
goto insert_cleanup;
}
@@ -336,7 +337,6 @@ void sqliteInsert(
/* Generate code to check constraints and generate index keys and
** do the insertion.
*/
- endOfLoop = sqliteVdbeMakeLabel(v);
sqliteGenerateConstraintChecks(pParse, pTab, base, 0,0,0,onError,endOfLoop);
sqliteCompleteInsertion(pParse, pTab, base, 0,0,0);
@@ -358,7 +358,7 @@ void sqliteInsert(
/* Code AFTER triggers */
if( sqliteCodeRowTrigger(pParse, TK_INSERT, 0, TK_AFTER, pTab, newIdx, -1,
- onError) ){
+ onError, endOfLoop) ){
goto insert_cleanup;
}
}