]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Ensure tests pass when SQLITE_OMIT_TRIGGER is defined. (CVS 2137)
authordanielk1977 <danielk1977@noemail.net>
Mon, 22 Nov 2004 11:51:13 +0000 (11:51 +0000)
committerdanielk1977 <danielk1977@noemail.net>
Mon, 22 Nov 2004 11:51:13 +0000 (11:51 +0000)
FossilOrigin-Name: 53894988ac1ad44ec65a1e1c420e2a26eb4c2efd

manifest
manifest.uuid
src/build.c
test/auth.test
test/vacuum.test

index 74766873febc159a3d4f692268fa947ee843c4ce..2182599ff99f1b2bbee568a00c06b0f947b414a9 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sa\stest-suite\serror\smade\sin\scheck-in\s(2132)\s(CVS\s2136)
-D 2004-11-22T10:20:13
+C Ensure\stests\spass\swhen\sSQLITE_OMIT_TRIGGER\sis\sdefined.\s(CVS\s2137)
+D 2004-11-22T11:51:13
 F Makefile.in 8291610f5839939a5fbff4dbbf85adb0fe1ac37f
 F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457
 F README a01693e454a00cc117967e3f9fdab2d4d52e9bc1
@@ -31,7 +31,7 @@ F src/attach.c e49d09dad9f5f9fb10b4b0c1be5a70ae4c45e689
 F src/auth.c 3b81f2a42f48a62c2c9c9b0eda31a157c681edea
 F src/btree.c edcd4abafe0db11081e4e2db854b17649bec27d9
 F src/btree.h 861e40b759a195ba63819740e484390012cf81ab
-F src/build.c c7dd57fdbb330d65df241277291cad8e58687a46
+F src/build.c b62389de594d0b413068d6e067794249a1f1d209
 F src/date.c 65536e7ea04fdde6e0551264fca15966966e171f
 F src/delete.c cf185995e20a61c0fecc2a9a9a3b19bd18bd05b3
 F src/expr.c 511c27a8858ca12614f495c9c90f5d12db11e6c2
@@ -87,7 +87,7 @@ F test/alter.test 2b4478c4906e4d1504b1a121b4ffbc8d11043b53
 F test/attach.test bb0ff048b0a65ca2bd5f186eee05d2ec084f3972
 F test/attach2.test 399128a7b3b209a339a8dbf53ca2ed42eb982d1a
 F test/attach3.test c05c70b933afbde0901dab9da3e66ee842c09f38
-F test/auth.test 38a0546692931383a5ef4f762c4202a48160df0a
+F test/auth.test 050fe904ab1b2654b0dbb776035833d64bcde3da
 F test/autoinc.test 11330758197e0301d3600a071230d45b2f6a65b7
 F test/autovacuum.test a4e8da39a6268378c4f9fc17fe2df1d5be16d631
 F test/autovacuum_crash.test 2dca85cbcc497098e45e8847c86407eb3554f3d4
@@ -195,7 +195,7 @@ F test/types2.test f23c147a2ab3e51d5dbcfa9987200db5acba7aa7
 F test/unique.test 0e38d4cc7affeef2527720d1dafd1f6870f02f2b
 F test/update.test b29bd9061a1150426dab6959806fcc73a41b1217
 F test/utf16.test 459c2f5ab80c60092c603630a348c32d6e59c558
-F test/vacuum.test 7d9eb0d4398cd326d14ee8673509a8565030467c
+F test/vacuum.test f18eccdee5b538d46298c64d6a060cfbf97bbc23
 F test/varint.test ab7b110089a08b9926ed7390e7e97bdefeb74102
 F test/view.test a68bee7f5b4e33656667cbf4748dcfc5ebe1828b
 F test/where.test 8a016d444252553a0c7c3a4c806d3f782f7337eb
@@ -259,7 +259,7 @@ F www/tclsqlite.tcl 560ecd6a916b320e59f2917317398f3d59b7cc25
 F www/vdbe.tcl 095f106d93875c94b47367384ebc870517431618
 F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0
 F www/whentouse.tcl fdacb0ba2d39831e8a6240d05a490026ad4c4e4c
-P ec6b48f4b2abea231b050a8a9d18c2ab12579c8e
-R 0b138ab4e569bea68e7531555ba597f5
+P 48c7eb7fb9fbc2166aaa7dbdb7c7e92c68f8eff3
+R 6dd508c54c10bef1b7e595fe1d4a4547
 U danielk1977
-Z 79e8cbc70189cea680ff0b42cb1f7509
+Z 55588ca2d1f74953c8ec1f40672d9644
index 7d0c208f6f3eb17e497027971ef81eaed2f13d68..739b3ae23caee994ce5d8108a2013b9223bb98a1 100644 (file)
@@ -1 +1 @@
-48c7eb7fb9fbc2166aaa7dbdb7c7e92c68f8eff3
\ No newline at end of file
+53894988ac1ad44ec65a1e1c420e2a26eb4c2efd
\ No newline at end of file
index 3a34bceb308b53a16739ef766f06691161f31f90..17c2986ad864323d011fd4613329133e9ab970ba 100644 (file)
@@ -22,7 +22,7 @@
 **     COMMIT
 **     ROLLBACK
 **
-** $Id: build.c,v 1.285 2004/11/20 18:13:10 drh Exp $
+** $Id: build.c,v 1.286 2004/11/22 11:51:13 danielk1977 Exp $
 */
 #include "sqliteInt.h"
 #include <ctype.h>
@@ -3017,7 +3017,10 @@ void sqlite3AlterRenameTable(
               "'sqlite_autoindex_' || %Q || substr(name, %d+18,10) "
             "ELSE name END "
       "WHERE tbl_name=%Q AND type IN ('table', 'index', 'trigger');", 
-      zDb, SCHEMA_TABLE(iDb), zName, zName, zName, zName, 
+      zDb, SCHEMA_TABLE(iDb), zName, zName, zName, 
+#ifndef SQLITE_OMIT_TRIGGER
+zName,
+#endif
       zName, strlen(pTab->zName), pTab->zName
   );
 
index acec238427230ae4aa6aa8ba72a8a2b5fc20c0ab..3a205de2cee7d65a9e37b72593e29484b1ef6e32 100644 (file)
@@ -12,7 +12,7 @@
 # focus of this script is testing the ATTACH and DETACH commands
 # and related functionality.
 #
-# $Id: auth.test,v 1.22 2004/11/22 08:43:32 danielk1977 Exp $
+# $Id: auth.test,v 1.23 2004/11/22 11:51:14 danielk1977 Exp $
 #
 
 set testdir [file dirname $argv0]
@@ -538,7 +538,7 @@ do_test auth-1.78 {
   execsql {SELECT name FROM sqlite_temp_master}
 } {t1}
 
-# Test cases auth-1.79 to auth-1.123 test creating and dropping views.
+# Test cases auth-1.79 to auth-1.124 test creating and dropping views.
 # Omit these if the library was compiled with views omitted.
 ifcapable view {
 do_test auth-1.79 {
@@ -811,6 +811,10 @@ do_test auth-1.124 {
 } {t1}
 } ;# ifcapable view
 
+# Test cases auth-1.125 to auth-1.176 test creating and dropping triggers.
+# Omit these if the library was compiled with triggers omitted.
+#
+ifcapable trigger {
 do_test auth-1.125 {
   proc auth {code arg1 arg2 arg3 arg4} {
     if {$code=="SQLITE_CREATE_TRIGGER"} {
@@ -1167,6 +1171,7 @@ do_test auth-1.175 {
 do_test auth-1.176 {
   execsql {SELECT name FROM sqlite_temp_master}
 } {t1}
+} ;# ifcapable trigger
 
 do_test auth-1.177 {
   proc auth {code arg1 arg2 arg3 arg4} {
@@ -1888,6 +1893,7 @@ do_test auth-2.11.2 {
 
 # Make sure the OLD and NEW pseudo-tables of a trigger get authorized.
 #
+ifcapable trigger {
 do_test auth-3.1 {
   proc auth {code arg1 arg2 arg3 arg4} {
     return SQLITE_OK
@@ -1914,9 +1920,11 @@ do_test auth-3.2 {
     SELECT * FROM tx;
   }
 } {12 112 2 2 {} {} 8 108 8 8 {} {}}
+} ;# ifcapable trigger
 
 # Make sure the names of views and triggers are passed on on arg4.
 #
+ifcapable trigger {
 do_test auth-4.1 {
   proc auth {code arg1 arg2 arg3 arg4} {
     lappend ::authargs $code $arg1 $arg2 $arg3 $arg4
@@ -1937,8 +1945,9 @@ do_test auth-4.1 {
   SQLITE_READ   t2 b  main r1 \
   SQLITE_READ   t2 c  main r1 \
   SQLITE_READ   t2 c  main r1]
+}
 
-ifcapable view {
+ifcapable {view && trigger} {
 do_test auth-4.2 {
   execsql {
     CREATE VIEW v1 AS SELECT a+b AS x FROM t2;
@@ -1987,6 +1996,6 @@ do_test auth-4.5 {
   SQLITE_INSERT v1chng {} main r3 \
   SQLITE_READ   v1     x  main r3]
 
-} ;# ifcapable view
+} ;# ifcapable view && trigger
 
 finish_test
index 521340fb253a7833a05c3710e3cc5b26f1f3ddf9..4a04c2a64e5da8e43042c2f0f69e020b7de611f3 100644 (file)
@@ -11,7 +11,7 @@
 # This file implements regression tests for SQLite library.  The
 # focus of this file is testing the VACUUM statement.
 #
-# $Id: vacuum.test,v 1.31 2004/11/22 08:43:32 danielk1977 Exp $
+# $Id: vacuum.test,v 1.32 2004/11/22 11:51:14 danielk1977 Exp $
 
 set testdir [file dirname $argv0]
 source $testdir/tester.tcl
@@ -90,17 +90,19 @@ do_test vacuum-1.4 {
     CREATE TABLE t2 AS SELECT * FROM t1;
     CREATE TABLE t3 AS SELECT * FROM t1;
     CREATE VIEW v1 AS SELECT b, c FROM t3;
-    CREATE TRIGGER r1 AFTER DELETE ON t2 BEGIN
-      SELECT 1;
-    END;
+    CREATE TRIGGER r1 AFTER DELETE ON t2 BEGIN SELECT 1; END;
     COMMIT;
     DROP TABLE t2;
   }
   # If the library was compiled to omit view support, comment out the
-  # create view in the script $sql_script before executing it.
+  # create view in the script $sql_script before executing it. Similarly,
+  # if triggers are not supported, comment out the trigger definition.
   ifcapable !view {
     regsub {CREATE VIEW} $sql_script {-- CREATE VIEW} sql_script
   }
+  ifcapable !trigger {
+    regsub {CREATE TRIGGER} $sql_script {-- CREATE TRIGGER} sql_script
+  }
   execsql $sql_script
   set ::size1 [file size test.db]
   set ::cksum [cksum]