Possible bug when compiling with SQLITE_OMIT_TRIGGER option

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Possible bug when compiling with SQLITE_OMIT_TRIGGER option

M Irya
Hello,

I'm trying to create a minimal SQLite3 library build and seems like the
foreign keys logic is not properly run on DELETE when building the sources
with -DSQLITE_OMIT_TRIGGER=1.

Here's the patch against amalgamation v3.21.0 sqlite.c:

--- sqlite3.c.orig 2017-12-08 14:06:04.814913000 +0100
+++ sqlite3.c 2017-12-08 14:06:26.125563000 +0100
@@ -105900,6 +105900,7 @@
 #else
 # define pTrigger 0
 # define isView 0
+  bComplex = sqlite3FkRequired(pParse, pTab, 0, 0);
 #endif
 #ifdef SQLITE_OMIT_VIEW
 # undef isView

Without that bComplex in sqlite3DeleteFrom() is at least undefined in the
if () condition 90 lines below.

Let me know if this looks correct/can be pushed to the official SQLite repo.

Regards,
KM
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users