]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix a problem with wal4.test caused by changes in the previous checkin.
authordan <dan@noemail.net>
Fri, 16 Jul 2010 11:10:25 +0000 (11:10 +0000)
committerdan <dan@noemail.net>
Fri, 16 Jul 2010 11:10:25 +0000 (11:10 +0000)
FossilOrigin-Name: 1218d3703ad23d01ce0d7cbcabdc9e0d864f8717

manifest
manifest.uuid
test/wal4.test

index d07a71433fcc4531f4443927b5f65eaebe54a752..eea9573a2f80c1a72018ca9ddaeee684a0df965b 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sa\stest\sscript\sbug\suncovered\sby\s[a121cd80c5]\sthat\swas\scausing\sshared_err.test\sto\sfail.
-D 2010-07-16T10:39:55
+C Fix\sa\sproblem\swith\swal4.test\scaused\sby\schanges\sin\sthe\sprevious\scheckin.
+D 2010-07-16T11:10:25
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in ec08dc838fd8110fe24c92e5130bcd91cbb1ff2e
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -780,7 +780,7 @@ F test/vtab_shared.test 0eff9ce4f19facbe0a3e693f6c14b80711a4222d
 F test/wal.test 1891e6f72dd437a1c2a48091aa9182ba17a8f780
 F test/wal2.test fa6dc4457b46988f46cf6c68ea51ebe341765f4a
 F test/wal3.test d2ae7e66f973bd6b58ce49e546b2c00f44fe0485
-F test/wal4.test 640be93f5422df37203aa5e7c06b24fb5e4a2439
+F test/wal4.test 3404b048fa5e10605facaf70384e6d2943412e30
 F test/wal_common.tcl 895d76138043b86bdccf36494054bdabcf65837b
 F test/walbak.test 4df1c7369da0301caeb9a48fa45997fd592380e4
 F test/walbig.test e882bc1d014afffbfa2b6ba36e0f07d30a633ad0
@@ -836,7 +836,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P abff795f38e33d778c8dd494a601bc029237da9e
-R 776af8e304d1d65c5041c3e233547932
+P d7b63a4c9fdd2acdb5829224b6189e7f2f6bedb9
+R 9e013fa25efc6beae188ec5b216899a1
 U dan
-Z 5f6c2eda8aae20a98f667879615f6770
+Z cdba553a1f0f8455a1ab27a44fc70403
index b5248bf736d90802eceb96a5257861bc2e03c6d4..e191bd336da86570e7d4bfc54ce141fba3fc1193 100644 (file)
@@ -1 +1 @@
-d7b63a4c9fdd2acdb5829224b6189e7f2f6bedb9
\ No newline at end of file
+1218d3703ad23d01ce0d7cbcabdc9e0d864f8717
\ No newline at end of file
index c255182cc2d6b05be6677cb66f49a1d13fa8c71f..22ccfea72d579ed7d7e5d6faf6eb938657a94958 100644 (file)
@@ -18,11 +18,7 @@ source $testdir/malloc_common.tcl
 ifcapable !wal {finish_test ; return }
 
 do_test wal4-1.1 {
-  db close
-  file delete -force wal4.db wal4.db-journal wal4.db-wal wal4.db-shm
-  file delete -force test.db test.db-journal test.db-wal test.db-shm
-  sqlite3 db2 wal4.db
-  db2 eval {
+  execsql {
     PRAGMA journal_mode=WAL;
     CREATE TABLE t1(x);
     INSERT INTO t1 VALUES(1);
@@ -30,23 +26,39 @@ do_test wal4-1.1 {
     SELECT x FROM t1 ORDER BY x;
   }
 } {wal 1 2}
+
 do_test wal4-1.2 {
-  file delete -force test.db test.db-journal test.db-wal
-  file copy wal4.db-wal test.db-wal
-  sqlite3 db test.db
-  catchsql {
-    SELECT * FROM t1;
-  }
+  # Save a copy of the file-system containing the wal and wal-index files 
+  # only (no database file).
+  faultsim_save_and_close
+  file delete -force sv_test.db
+} {}
+
+do_test wal4-1.3 {
+  faultsim_restore_and_reopen
+  catchsql { SELECT * FROM t1 }
 } {1 {no such table: t1}}
 
-do_malloc_test wal4-2.0 -tclprep {
-  db close
-  file delete -force test.db test.db-journal test.db-wal
-  file copy wal4.db-wal test.db-wal
-  sqlite3 db test.db
-} -sqlbody {
-  SELECT name FROM sqlite_master
-}  
+do_faultsim_test wal4-2 -prep {
+  faultsim_restore_and_reopen
+} -body {
+  execsql { SELECT name FROM sqlite_master }
+} -test {
+  # Result should be zero rows (empty db file).
+  #
+  faultsim_test_result {0 {}}
 
+  # If the SELECT finished successfully, the WAL file should have been
+  # deleted. In no case should the database file have been written, so
+  # it should still be zero bytes in size regardless of whether or not
+  # a fault was injected. Test these assertions:
+  #
+  if { $testrc==0 && [file exists test.db-wal] } { 
+    error "Wal file was not deleted"
+  }
+  if { [file size test.db]!=0 } { 
+    error "Db file grew to [file size test.db] bytes"
+  }
+}
 
 finish_test