aboutsummaryrefslogtreecommitdiff
path: root/src/update.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/update.c')
-rw-r--r--src/update.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/update.c b/src/update.c
index ca1500078..1905c3073 100644
--- a/src/update.c
+++ b/src/update.c
@@ -12,7 +12,7 @@
** This file contains C code routines that are called by the parser
** to handle UPDATE statements.
**
-** $Id: update.c,v 1.90 2004/10/05 02:41:43 drh Exp $
+** $Id: update.c,v 1.91 2004/10/31 02:22:49 drh Exp $
*/
#include "sqliteInt.h"
@@ -67,12 +67,28 @@ void sqlite3Update(
*/
pTab = sqlite3SrcListLookup(pParse, pTabList);
if( pTab==0 ) goto update_cleanup;
+
+ /* Figure out if we have any triggers and if the table being
+ ** updated is a view
+ */
+#ifndef SQLITE_OMIT_TRIGGER
before_triggers = sqlite3TriggersExist(pParse, pTab->pTrigger,
- TK_UPDATE, TK_BEFORE, TK_ROW, pChanges);
+ TK_UPDATE, TK_BEFORE, TK_ROW, pChanges);
after_triggers = sqlite3TriggersExist(pParse, pTab->pTrigger,
- TK_UPDATE, TK_AFTER, TK_ROW, pChanges);
+ TK_UPDATE, TK_AFTER, TK_ROW, pChanges);
row_triggers_exist = before_triggers || after_triggers;
isView = pTab->pSelect!=0;
+#else
+# define before_triggers 0
+# define after_triggers 0
+# define row_triggers_exist 0
+# define isView 0
+#endif
+#ifdef SQLITE_OMIT_VIEW
+# undef isView
+# define isView 0
+#endif
+
if( sqlite3IsReadOnly(pParse, pTab, before_triggers) ){
goto update_cleanup;
}