]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add an extra test case for crash recovery.
authordan <dan@noemail.net>
Mon, 22 Mar 2010 17:38:11 +0000 (17:38 +0000)
committerdan <dan@noemail.net>
Mon, 22 Mar 2010 17:38:11 +0000 (17:38 +0000)
FossilOrigin-Name: f2326dad4e47b2657be302e194970967960eb1c0

manifest
manifest.uuid
test/crash8.test

index 65dabbc76915b4f7ed2ae20fde07a98ae9275b12..26215144ae5624c15226eef27bf2e7cb58c08f6e 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C After\sa\srollback\sthat\swrites\sor\struncates\sthe\sdatabase\sfile,\ssync\sthe\sdatabase\sfile\sbefore\sinvalidating\sthe\sjournal\scontents.
-D 2010-03-22T17:13:53
+C Add\san\sextra\stest\scase\sfor\scrash\srecovery.
+D 2010-03-22T17:38:11
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in 4f2f967b7e58a35bb74fb7ec8ae90e0f4ca7868b
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -314,7 +314,7 @@ F test/crash4.test 02ff4f15c149ca1e88a5c299b4896c84d9450c3b
 F test/crash5.test 80a2f7073381837fc082435c97df52a830abcd80
 F test/crash6.test 9c730cf06335003cb1f5cfceddacd044155336e0
 F test/crash7.test e20a7b9ee1d16eaef7c94a4cb7ed2191b4d05970
-F test/crash8.test 167fbacd3e301c54c69930432134d9e4e86a1ac3
+F test/crash8.test a6742d8196ac426be4c547b27fd2e24236b66c82
 F test/crashtest1.c 09c1c7d728ccf4feb9e481671e29dda5669bbcc2
 F test/createtab.test 199cf68f44e5d9e87a0b8afc7130fdeb4def3272
 F test/cse.test 277350a26264495e86b1785f34d2d0c8600e021c
@@ -793,7 +793,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P ad68fa65bbd6b82e69fe8c36e4c459ea2ced0f8c
-R da2830191169e82dff44001b6ff66f57
+P b21b911f233842357af9ccc14525bbd48a38edb1
+R ffd53e378ecdea15b6b3ff7659ae3ab4
 U dan
-Z 80e6e915ad885752ec643850a26719f6
+Z 60f0c36d7fc83afd295b943f92e6fd9c
index 4983e96da876bcc88fd3727ae38774b98d32a2aa..321b0521b58db5aa78fec3adbd22785e006f728c 100644 (file)
@@ -1 +1 @@
-b21b911f233842357af9ccc14525bbd48a38edb1
\ No newline at end of file
+f2326dad4e47b2657be302e194970967960eb1c0
\ No newline at end of file
index 320e1a6c8aa3a53e7ac4c76463b294c7775fcd9b..5d947e1da935be392a0a399bbb428a392ac1b8ee 100644 (file)
@@ -340,30 +340,61 @@ ifcapable pragma {
   } {jkl}
 }
 
-catch { db close }
-file delete -force test.db test.db-journal
-sqlite3 db test.db
-
-do_test crash8-5.1 {
-  execsql {
-    CREATE TABLE t1(x PRIMARY KEY);
-    INSERT INTO t1 VALUES(randomblob(900));
-    INSERT INTO t1 SELECT randomblob(900) FROM t1;
-    INSERT INTO t1 SELECT randomblob(900) FROM t1;
-    INSERT INTO t1 SELECT randomblob(900) FROM t1;
-    INSERT INTO t1 SELECT randomblob(900) FROM t1;
-    INSERT INTO t1 SELECT randomblob(900) FROM t1;
-    INSERT INTO t1 SELECT randomblob(900) FROM t1;          /* 64 */
-  }
-  crashsql -file test.db -delay 1 {
-    PRAGMA cache_size = 10;
-    BEGIN;
-      UPDATE t1 SET x = randomblob(900);
-    ROLLBACK;
-    INSERT INTO t1 VALUES(randomblob(900));
-  }
-  execsql { PRAGMA integrity_check }
-} {ok}
+for {set i 1} {$i < 10} {incr i} {
+  catch { db close }
+  file delete -force test.db test.db-journal
+  sqlite3 db test.db
+  do_test crash8-5.$i.1 {
+    execsql {
+      CREATE TABLE t1(x PRIMARY KEY);
+      INSERT INTO t1 VALUES(randomblob(900));
+      INSERT INTO t1 SELECT randomblob(900) FROM t1;
+      INSERT INTO t1 SELECT randomblob(900) FROM t1;
+      INSERT INTO t1 SELECT randomblob(900) FROM t1;
+      INSERT INTO t1 SELECT randomblob(900) FROM t1;
+      INSERT INTO t1 SELECT randomblob(900) FROM t1;
+      INSERT INTO t1 SELECT randomblob(900) FROM t1;          /* 64 rows */
+    }
+    crashsql -file test.db -delay [expr ($::i%2) + 1] {
+      PRAGMA cache_size = 10;
+      BEGIN;
+        UPDATE t1 SET x = randomblob(900);
+      ROLLBACK;
+      INSERT INTO t1 VALUES(randomblob(900));
+    }
+    execsql { PRAGMA integrity_check }
+  } {ok}
+  
+  catch { db close }
+  file delete -force test.db test.db-journal
+  sqlite3 db test.db
+  do_test crash8-5.$i.2 {
+    execsql {
+      PRAGMA cache_size = 10;
+      CREATE TABLE t1(x PRIMARY KEY);
+      INSERT INTO t1 VALUES(randomblob(900));
+      INSERT INTO t1 SELECT randomblob(900) FROM t1;
+      INSERT INTO t1 SELECT randomblob(900) FROM t1;
+      INSERT INTO t1 SELECT randomblob(900) FROM t1;
+      INSERT INTO t1 SELECT randomblob(900) FROM t1;
+      INSERT INTO t1 SELECT randomblob(900) FROM t1;
+      INSERT INTO t1 SELECT randomblob(900) FROM t1;          /* 64 rows */
+      BEGIN;
+        UPDATE t1 SET x = randomblob(900);
+    }
+    file delete -force testX.db testX.db-journal
+    copy_file test.db testX.db
+    copy_file test.db-journal testX.db-journal
+    db close
+
+    crashsql -file test.db -delay [expr ($::i%2) + 1] {
+      SELECT * FROM sqlite_master;
+      INSERT INTO t1 VALUES(randomblob(900));
+    }
 
+    sqlite3 db2 testX.db
+    execsql { PRAGMA integrity_check } db2
+  } {ok}
+}
 
 finish_test