-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
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
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
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);
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