]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add a test to simulate an OOM during log recovery to walfault.test.
authordan <dan@noemail.net>
Mon, 3 May 2010 18:01:21 +0000 (18:01 +0000)
committerdan <dan@noemail.net>
Mon, 3 May 2010 18:01:21 +0000 (18:01 +0000)
FossilOrigin-Name: 7ed85e87dd206083310ba28afab4389885f61dac

manifest
manifest.uuid
test/malloc_common.tcl
test/walfault.test

index 7cfc02fe622d15704e84c8e414e3bace4989b9c2..b67e68881c28e9a9334b46653193b6ab4e7be2ca 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,8 +1,5 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
-C Clear\sglobal\svariable\s"seconds"\sbefore\suse\sin\swalthread.test.
-D 2010-05-03T17:24:45
+C Add\sa\stest\sto\ssimulate\san\sOOM\sduring\slog\srecovery\sto\swalfault.test.
+D 2010-05-03T18:01:22
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in d83a0ffef3dcbfb08b410a6c6dd6c009ec9167fb
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -506,7 +503,7 @@ F test/mallocH.test 79b65aed612c9b3ed2dcdaa727c85895fd1bfbdb
 F test/mallocI.test e3ea401904d010cb7c1e4b2ee8803f4a9f5b999d
 F test/mallocJ.test b5d1839da331d96223e5f458856f8ffe1366f62e
 F test/mallocK.test d79968641d1b70d88f6c01bdb9a7eb4a55582cc9
-F test/malloc_common.tcl 984baeb6c6b185e798827d1187d426acc2bc4962
+F test/malloc_common.tcl 206a1694c0d30cb8b8cbdda68ab8e1f232fd1ab9
 F test/manydb.test b3d3bc4c25657e7f68d157f031eb4db7b3df0d3c
 F test/memdb.test 0825155b2290e900264daaaf0334b6dfe69ea498
 F test/memleak.test d2d2a1ff7105d32dc3fdf691458cf6cba58c7217
@@ -764,7 +761,7 @@ F test/vtab_shared.test 0eff9ce4f19facbe0a3e693f6c14b80711a4222d
 F test/wal.test 0223196f4311a504b0127746613c4434054f7968
 F test/walbak.test a0e45187c7d8928df035dfea29b99b016b21ca3c
 F test/walcrash.test 63edc6a9e05f645b54d649186a5818fc82953e2e
-F test/walfault.test 51ffa1eb3e12d63355100888ad183f06e6ffdafb
+F test/walfault.test cdd1a27ed89bcb14596005ab2477b3724dd5f805
 F test/walhook.test 5f18e0fc8787f1f8889d7a9971af18f334f83786
 F test/walmode.test bac6f06544a8554588a1543def996bbe2fc41792
 F test/walslow.test d21625e2e99e11c032ce949e8a94661576548933
@@ -812,14 +809,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P 9d3f3736be42ef8ab48b099d4712e08dfca97873
-R 352c433be6f612896dc16081fdef01f7
-U drh
-Z c9af523ce17ec290d0e69ce8e0d5eb0f
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.6 (GNU/Linux)
-
-iD8DBQFL3wbhoxKgR168RlERAmHUAJ0R3+PtPhUWqPAp0hNk6HIh36rbcgCfUYu7
-umIGiqAmPFCNkQspbbGTlrc=
-=gdS9
------END PGP SIGNATURE-----
+P a35551a5305b5160b0eb511da7f8e6fb351ef271
+R 196202511a2c780c88fa3597907d5285
+U dan
+Z 63af9feaaec4bfa813085abfe4d8e201
index 28dbf4b1b1bc6e1ef24f60044d6f0a554d69cd1f..96da1b67e44afec7c6758f4a8db0be3c280353f4 100644 (file)
@@ -1 +1 @@
-a35551a5305b5160b0eb511da7f8e6fb351ef271
\ No newline at end of file
+7ed85e87dd206083310ba28afab4389885f61dac
\ No newline at end of file
index 90f6b06726a850383645e77cb6cfa098383d6c85..9b4c17f0c68e83c95077b291833f5b24c2b21fac 100644 (file)
@@ -89,8 +89,10 @@ proc do_malloc_test {tn args} {
         catch {db close} 
         catch {file delete -force test.db}
         catch {file delete -force test.db-journal}
+        catch {file delete -force test.db-wal}
         catch {file delete -force test2.db}
         catch {file delete -force test2.db-journal}
+        catch {file delete -force test2.db-wal}
         if {[info exists ::mallocopts(-testdb)]} {
           file copy $::mallocopts(-testdb) test.db
         }
index 5043c46acbbd22b63b5a599a46bb6686c45a895a..48bb3b70c03dcd402803dfed01bac1cdc43f92fe 100644 (file)
@@ -26,5 +26,31 @@ do_malloc_test walfault-oom-1 -sqlbody {
   PRAGMA checkpoint;
 }
 
+do_malloc_test walfault-oom-2 -tclprep {
+  execsql {
+    PRAGMA journal_mode = WAL;
+    BEGIN;
+      CREATE TABLE x(y, z, UNIQUE(y, z));
+      INSERT INTO x VALUES(randomblob(100), randomblob(100));
+    COMMIT;
+    PRAGMA wal_checkpoint;
+
+    INSERT INTO x SELECT randomblob(100), randomblob(100) FROM x;
+    INSERT INTO x SELECT randomblob(100), randomblob(100) FROM x;
+    INSERT INTO x SELECT randomblob(100), randomblob(100) FROM x;
+  }
+  file copy -force test.db testX.db
+  file copy -force test.db-wal testX.db-wal
+  db close
+  file rename -force testX.db test.db
+  file rename -force testX.db-wal test.db-wal
+
+  sqlite3 db test.db
+  sqlite3_extended_result_codes db 1
+  sqlite3_db_config_lookaside db 0 0 0
+} -sqlbody {
+  SELECT count(*) FROM x;
+}
+
 
 finish_test