]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Disable multiplexing of master-journal files in the test_multiplex.c module.
authordan <dan@noemail.net>
Thu, 12 Mar 2015 19:12:30 +0000 (19:12 +0000)
committerdan <dan@noemail.net>
Thu, 12 Mar 2015 19:12:30 +0000 (19:12 +0000)
FossilOrigin-Name: b8684df395b5585a9428417c2bfd076515560f19

manifest
manifest.uuid
src/test_multiplex.c
test/crashM.test [new file with mode: 0644]

index eb1ce5769c0bf61b2218f670b52cf3971cda0afa..7b212453010f18aa09f7f34c5982a141c7762a06 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Improve\sthe\stext\son\sone\sof\sthe\sopcode\sdocumentation\scomments\sin\svdbe.c.
-D 2015-03-12T05:08:34.697
+C Disable\smultiplexing\sof\smaster-journal\sfiles\sin\sthe\stest_multiplex.c\smodule.
+D 2015-03-12T19:12:30.098
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 88a3e6261286db378fdffa1124cad11b3c05f5bb
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -266,7 +266,7 @@ F src/test_intarray.h 9dc57417fb65bc7835cc18548852cc08cc062202
 F src/test_journal.c 5360fbe1d1e4416ca36290562fd5a2e3f70f32aa
 F src/test_loadext.c a5251f956ab6af21e138dc1f9c0399394a510cb4
 F src/test_malloc.c b9495384e74923aefde8311de974bf9b0f5ba570
-F src/test_multiplex.c 61edf02530f7511a0529352cd8139ead3af4c401
+F src/test_multiplex.c 97813565daa7ee480abcc5dd1e9984ed1f71eb8c
 F src/test_multiplex.h c08e4e8f8651f0c5e0509b138ff4d5b43ed1f5d3
 F src/test_mutex.c 293042d623ebba969160f471a82aa1551626454f
 F src/test_onefile.c 0396f220561f3b4eedc450cef26d40c593c69a25
@@ -442,6 +442,7 @@ F test/crash5.test 05dd3aa9dbb751a22d5cdaf22a9c49b6667aa219
 F test/crash6.test 4c56f1e40d0291e1110790a99807aa875b1647ba
 F test/crash7.test 1a194c4900a255258cf94b7fcbfd29536db572df
 F test/crash8.test 61442a9964ab6b124fc5254e4258b45747842e6f
+F test/crashM.test d95f59046fa749b0d0822edf18a717788c8f318d
 F test/crashtest1.c 09c1c7d728ccf4feb9e481671e29dda5669bbcc2
 F test/createtab.test b5de160630b209c4b8925bdcbbaf48cc90b67fe8
 F test/cse.test 277350a26264495e86b1785f34d2d0c8600e021c
@@ -1241,7 +1242,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P a2715b049a86555990abccc7aa363c524ddb9982
-R 1bec88e395839df1ba1894bf7660872a
-U drh
-Z 0eea53c05ab1bdce3a6e00e90246f492
+P 08958f57970d2346f3e98e62225e2b5d351d12d8
+R 0a12f0c8ae987d613ddb45d39ab86f14
+U dan
+Z 376d550a3accda483a2b851b4ef12904
index 8c4aa9928d980502fee3fa4df9fad25f8c12f6e0..c810d416da7ff8482d977dcaf78f2bb5e3030a8a 100644 (file)
@@ -1 +1 @@
-08958f57970d2346f3e98e62225e2b5d351d12d8
\ No newline at end of file
+b8684df395b5585a9428417c2bfd076515560f19
\ No newline at end of file
index dbd395d6205e146c6bc461233d14bff9bca78e79..cd379f18f659073c45d5b54dd85994e287dc653c 100644 (file)
@@ -573,6 +573,9 @@ static int multiplexOpen(
       rc = pSubOpen->pMethods->xFileSize(pSubOpen, &sz);
       if( rc==SQLITE_OK && zName ){
         int bExists;
+        if( flags & SQLITE_OPEN_MASTER_JOURNAL ){
+          pGroup->bEnabled = 0;
+        }else
         if( sz==0 ){
           if( flags & SQLITE_OPEN_MAIN_JOURNAL ){
             /* If opening a main journal file and the first chunk is zero
diff --git a/test/crashM.test b/test/crashM.test
new file mode 100644 (file)
index 0000000..de10c45
--- /dev/null
@@ -0,0 +1,80 @@
+# 2015 Mar 13
+#
+# The author disclaims copyright to this source code.  In place of
+# a legal notice, here is a blessing:
+#
+#    May you do good and not evil.
+#    May you find forgiveness for yourself and forgive others.
+#    May you share freely, never taking more than you give.
+#
+#***********************************************************************
+#
+# Crash tests for the multiplex module with 8.3 filenames enabled.
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+set testprefix crashM
+
+ifcapable !crashtest||!8_3_names {
+  finish_test
+  return
+}
+
+db close
+sqlite3_shutdown
+sqlite3_config_uri 1
+
+foreach f [glob -nocomplain test1.* test2.*] { forcedelete $f }
+sqlite3_multiplex_initialize "" 1
+sqlite3 db file:test1.db?8_3_names=1
+sqlite3_multiplex_control db main chunk_size [expr 64*1024]
+
+do_execsql_test 1.0 {
+  ATTACH 'file:test2.db?8_3_names=1' AS aux;
+
+  CREATE TABLE t1(x, y);
+  CREATE INDEX t1x ON t1(x);
+  CREATE INDEX t1y ON t1(y);
+
+  CREATE TABLE aux.t2(x, y);
+  CREATE INDEX aux.t2x ON t2(x);
+  CREATE INDEX aux.t2y ON t2(y);
+
+  WITH s(a) AS (
+    SELECT 1 UNION ALL SELECT a+1 FROM s WHERE a<1000
+  )
+  INSERT INTO t1 SELECT a, randomblob(500) FROM s;
+
+  WITH s(a) AS (
+    SELECT 1 UNION ALL SELECT a+1 FROM s WHERE a<1000
+  )
+  INSERT INTO t2 SELECT a, randomblob(500) FROM s;
+} {}
+
+for {set i 0} {$i < 20} {incr i} {
+  do_test 2.$i.1 {
+    crashsql -delay 1 -file test1.db -opendb {
+      sqlite3_shutdown
+      sqlite3_config_uri 1
+      sqlite3_multiplex_initialize crash 1
+      sqlite3 db file:test1.db?8_3_names=1
+      sqlite3_multiplex_control db main chunk_size [expr 64*1024]
+    } {
+      ATTACH 'file:test2.db?8_3_names=1' AS aux;
+      BEGIN;
+        UPDATE t1 SET y = randomblob(500) WHERE (x%10)==0;
+        UPDATE t2 SET y = randomblob(500) WHERE (x%10)==0;
+      COMMIT;
+    }
+  } {1 {child process exited abnormally}}
+
+  do_execsql_test 2.$i.2 {
+    PRAGMA main.integrity_check;
+    PRAGMA aux.integrity_check;
+  } {ok ok}
+}
+
+catch { db close }
+sqlite3_multiplex_shutdown
+finish_test