]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add tests that demonstrate that PRAGMA defer_foreign_keys will reset to off
authordrh <drh@noemail.net>
Sat, 12 Oct 2013 13:16:15 +0000 (13:16 +0000)
committerdrh <drh@noemail.net>
Sat, 12 Oct 2013 13:16:15 +0000 (13:16 +0000)
at the conclusion of the next transaction.

FossilOrigin-Name: 67e28a11de97e97889f0c0f41c05605721c605c1

manifest
manifest.uuid
test/fkey6.test

index af48feaddab4e18f1dbbd72c37bfd8e8ff79fb85..6be0e9f5fbbf8cb7c2fc6dccb82d34cd7505258a 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sharmless\scompiler\swarning.
-D 2013-10-12T02:33:22.853
+C Add\stests\sthat\sdemonstrate\sthat\sPRAGMA\sdefer_foreign_keys\swill\sreset\sto\soff\nat\sthe\sconclusion\sof\sthe\snext\stransaction.
+D 2013-10-12T13:16:15.885
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in e2d28ec95bd17ab4f3b6ee40b7102e9d7a0857b9
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -463,7 +463,7 @@ F test/fkey2.test 06e0b4cc9e1b3271ae2ae6feeb19755468432111
 F test/fkey3.test 5ec899d12b13bcf1e9ef40eff7fb692fdb91392e
 F test/fkey4.test 86446017011273aad8f9a99c1a65019e7bd9ca9d
 F test/fkey5.test 2b8c761ad23bb6a95b9cf8366c9a982a80a439c2
-F test/fkey6.test c1d7cb176648e0e1e9f971f5f9bde4dd5bcd046d
+F test/fkey6.test aaf64e18e68fd9967e6accec65e2598ccefcb1e4
 F test/fkey7.test e31d0e71a41c1d29349a16448d6c420e2c53a8fc
 F test/fkey_malloc.test bb74c9cb8f8fceed03b58f8a7ef2df98520bbd51
 F test/format4.test 1f0cac8ff3895e9359ed87e41aaabee982a812eb
@@ -1123,7 +1123,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01
 F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff
-P 035d03e94252f31025b39da49d8401933352fb77
-R 674aebabd5ad2749788043a817e7f011
-U mistachkin
-Z fc9cb3270f125330055c4b37111cf872
+P 4b130f88fba216e088f61252bbcdde57ec7ee6a9
+R 99a9e83f60fa4dd81ccd94c036548c85
+U drh
+Z 4e218592d1ebb0a4d1a6f06c784de251
index de1b48360a8cd3866b638bf453f77b00bd47a3f0..e1694f337c6d299d9929c66c1d781e99fbd27e55 100644 (file)
@@ -1 +1 @@
-4b130f88fba216e088f61252bbcdde57ec7ee6a9
\ No newline at end of file
+67e28a11de97e97889f0c0f41c05605721c605c1
\ No newline at end of file
index 1c77c3d0518edb2b169fdccb950907fccead425c..2ca364e4e3586c02fb6bdac9816d6aceb426f6cf 100644 (file)
@@ -81,12 +81,23 @@ do_test fkey6-1.8 {
 do_test fkey6-1.9 {
   sqlite3_db_status db DBSTATUS_DEFERRED_FKS 0
 } {0 1 0}
-do_test fkey6-1.10 {
-  execsql {
-    ROLLBACK;
-    PRAGMA defer_foreign_keys=OFF;
-    BEGIN;
-  }
+
+# EVIDENCE-OF: R-21752-26913 The defer_foreign_keys pragma is
+# automatically switched off at each COMMIT or ROLLBACK. Hence, the
+# defer_foreign_keys pragma must be separately enabled for each
+# transaction.
+do_execsql_test fkey6-1.10.1 {
+  PRAGMA defer_foreign_keys;
+  ROLLBACK;
+  PRAGMA defer_foreign_keys;
+  BEGIN;
+  PRAGMA defer_foreign_keys=ON;
+  PRAGMA defer_foreign_keys;
+  COMMIT;
+  PRAGMA defer_foreign_keys;
+  BEGIN;
+} {1 0 1 0}
+do_test fkey6-1.10.2 {
   catchsql {DELETE FROM t1 WHERE x=3}
 } {1 {foreign key constraint failed}}
 db eval {ROLLBACK}