From: dan Date: Thu, 8 Jul 2010 06:22:25 +0000 (+0000) Subject: Add tests to walmode.test. X-Git-Tag: version-3.7.2~159 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8700b1e52d05f9e0ee95f867b59064b0e1c8f66b;p=thirdparty%2Fsqlite.git Add tests to walmode.test. FossilOrigin-Name: 5aa2bdb502d70ccbc249a6b38b8a07b91c4ccd26 --- diff --git a/manifest b/manifest index a29e308e91..9248208cc1 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Changes\sto\sos_win.c\sto\shave\sit\ssimulate\sIO\serrors\slike\sos_unix.c. -D 2010-07-08T03:13:33 +C Add\stests\sto\swalmode.test. +D 2010-07-08T06:22:26 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in c4270a1cd7cd70a263b7e96a258aa90e9c3618eb F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -785,7 +785,7 @@ F test/walcrash.test f6d5fb2bb108876f04848720a488065d9deef69f F test/walcrash2.test 019d60b89d96c1937adb2b30b850ac7e86e5a142 F test/walfault.test 05c470688d742688e455dd56816bd6bcffa298f8 F test/walhook.test ed00a40ba7255da22d6b66433ab61fab16a63483 -F test/walmode.test 463a730bc67990c08437616c2dd35a4e5dc82c30 +F test/walmode.test 0c0687ca696762e4fb5ede3a616d1991d1477614 F test/walslow.test d21625e2e99e11c032ce949e8a94661576548933 F test/walthread.test a25a393c068a2b42b44333fa3fdaae9072f1617c F test/where.test de337a3fe0a459ec7c93db16a519657a90552330 @@ -832,7 +832,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P baa5eddd0539342945c14a2793c2579efb7e3b26 -R 8a54ccb3e7c4dd33b01e301fc19bce15 -U shaneh -Z 74994333182dfeeb327944a6c7be56de +P 0d53da9451fe016adc57c7c077fdbbbdb1c8d6ee +R b58a5775e3725a5f103ee1708fc4f9f4 +U dan +Z 0c9a27a3186e4aa1ec68825ca3150943 diff --git a/manifest.uuid b/manifest.uuid index 89398a97c4..d6842d488d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0d53da9451fe016adc57c7c077fdbbbdb1c8d6ee \ No newline at end of file +5aa2bdb502d70ccbc249a6b38b8a07b91c4ccd26 \ No newline at end of file diff --git a/test/walmode.test b/test/walmode.test index 410019c932..b2a95f3c53 100644 --- a/test/walmode.test +++ b/test/walmode.test @@ -289,6 +289,11 @@ foreach {tn mode} { } db close +#------------------------------------------------------------------------- +# Test the effect of a "PRAGMA journal_mode" command being the first +# thing executed by a new connection. This means that the schema is not +# loaded when sqlite3_prepare_v2() is called to compile the statement. +# do_test walmode-7.0 { file delete -force test.db sqlite3 db test.db @@ -324,4 +329,44 @@ foreach {tn sql result} { } db close +#------------------------------------------------------------------------- +# Test the effect of a "PRAGMA journal_mode" command on an attached +# database. +# +faultsim_delete_and_reopen +do_execsql_test walmode-8.1 { + CREATE TABLE t1(a, b); + PRAGMA journal_mode = WAL; + ATTACH 'test.db2' AS two; + CREATE TABLE two.t2(a, b); +} {wal} +do_execsql_test walmode-8.2 { PRAGMA main.journal_mode } {wal} +do_execsql_test walmode-8.3 { PRAGMA two.journal_mode } {wal} +do_execsql_test walmode-8.4 { PRAGMA two.journal_mode = DELETE } {delete} + +db close +sqlite3 db test.db +do_execsql_test walmode-8.5 { ATTACH 'test.db2' AS two } {} +do_execsql_test walmode-8.6 { PRAGMA main.journal_mode } {wal} +do_execsql_test walmode-8.7 { PRAGMA two.journal_mode } {delete} +do_execsql_test walmode-8.8 { INSERT INTO two.t2 DEFAULT VALUES } {} +do_execsql_test walmode-8.9 { PRAGMA two.journal_mode } {delete} +do_execsql_test walmode-8.10 { INSERT INTO t1 DEFAULT VALUES } {} +do_execsql_test walmode-8.11 { PRAGMA main.journal_mode } {wal} +do_execsql_test walmode-8.12 { PRAGMA journal_mode } {delete} + +db close +sqlite3 db test.db +do_execsql_test walmode-8.13 { PRAGMA journal_mode = WAL } {wal} +do_execsql_test walmode-8.14 { ATTACH 'test.db2' AS two } {} +do_execsql_test walmode-8.15 { PRAGMA main.journal_mode } {wal} +do_execsql_test walmode-8.16 { PRAGMA two.journal_mode } {wal} +do_execsql_test walmode-8.17 { INSERT INTO two.t2 DEFAULT VALUES } {} +do_execsql_test walmode-8.18 { PRAGMA two.journal_mode } {wal} + +sqlite3 db2 test.db2 +do_test walmode-8.19 { execsql { PRAGMA main.journal_mode } db2 } {wal} +db2 close + finish_test +