From: drh Date: Mon, 20 Apr 2009 13:32:33 +0000 (+0000) Subject: Add new tests to show that journal_mode=OFF works with locking_mode=EXCLUSIVE X-Git-Tag: version-3.6.15~225 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6e7ecb4213184a7f90e9e6a11ae682ea1f6de7c;p=thirdparty%2Fsqlite.git Add new tests to show that journal_mode=OFF works with locking_mode=EXCLUSIVE as long as the journal_mode is set prior to the first transaction. Ticket #3811. (CVS 6525) FossilOrigin-Name: e62ac26f72224a4ba6c7dc5c32b7e4370461764d --- diff --git a/manifest b/manifest index 9122a56868..7c014b8bb8 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Clarify\sthe\sdocumentation\sto\smake\sit\sclear\sthat\ssqlite3_interrupt()\sdoes\snot\neffect\snew\sSQL\sstatements\sthat\sare\sstarted\safter\sthe\srunning\sstatement\ncount\sreaches\szero.\s\sTicket\s#3815.\s(CVS\s6524) -D 2009-04-20T12:31:46 +C Add\snew\stests\sto\sshow\sthat\sjournal_mode=OFF\sworks\swith\slocking_mode=EXCLUSIVE\nas\slong\sas\sthe\sjournal_mode\sis\sset\sprior\sto\sthe\sfirst\stransaction.\nTicket\s#3811.\s(CVS\s6525) +D 2009-04-20T13:32:33 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in 583e87706abc3026960ed759aff6371faf84c211 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -422,6 +422,7 @@ F test/join5.test 86675fc2919269aa923c84dd00ee4249b97990fe F test/journal1.test 36f2d1bb9bf03f790f43fbdb439e44c0657fab19 F test/jrnlmode.test 05e1e187c5b64022e832761674ee2395f3267d01 F test/jrnlmode2.test bd846e10d463c0b6f8bded674cb07f94a0277097 +F test/jrnlmode3.test 4e9a1f6099a13ec863720de981e3044f735f02bf F test/keyword1.test a2400977a2e4fde43bf33754c2929fda34dbca05 F test/lastinsert.test 474d519c68cb79d07ecae56a763aa7f322c72f51 F test/laststmtchanges.test ae613f53819206b3222771828d024154d51db200 @@ -717,7 +718,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P 7f17956dfbf3090fd5832378e77bd83a525fed9d -R d1e1a18f11c4de466ad80d4a9f7793a2 +P 3182e8bf69eb4e5e4070930cb9c750942b1dc735 +R 63b3c0e9e8b9bff8f84a79194299cadb U drh -Z 77d93c4b66bd2965475a96f202c117d9 +Z b0e0f5d2013af325cce1fe669e1d8579 diff --git a/manifest.uuid b/manifest.uuid index cb6df4febb..24829e0b6b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3182e8bf69eb4e5e4070930cb9c750942b1dc735 \ No newline at end of file +e62ac26f72224a4ba6c7dc5c32b7e4370461764d \ No newline at end of file diff --git a/test/jrnlmode3.test b/test/jrnlmode3.test new file mode 100644 index 0000000000..7756104e81 --- /dev/null +++ b/test/jrnlmode3.test @@ -0,0 +1,70 @@ +# 2009 April 20 +# +# The author disclaims copyright to this source code. In place of +# a legal notice, here is a blessing: +# +# May you do good and not evil. +# May you find forgiveness for yourself and forgive others. +# May you share freely, never taking more than you give. +# +#*********************************************************************** +# +# $Id: jrnlmode3.test,v 1.4 2009/04/20 13:32:33 drh Exp $ + +set testdir [file dirname $argv0] +source $testdir/tester.tcl + +ifcapable {!pager_pragmas} { + finish_test + return +} + +# Ticket #3811 +# +# Verify that journal_mode=OFF works as long as it occurs before the first +# transaction, even if locking_mode=EXCLUSIVE is enabled. The behavior if +# journal_mode is changed after the first transaction is undefined and hence +# untested. +# +do_test jrnlmode3-1.1 { + db eval { + PRAGMA journal_mode=OFF; + PRAGMA locking_mode=EXCLUSIVE; + CREATE TABLE t1(x); + INSERT INTO t1 VALUES(1); + SELECT * FROM t1; + } +} {off exclusive 1} +do_test jrnlmode3-1.2 { + db eval { + BEGIN; + INSERT INTO t1 VALUES(2); + ROLLBACK; + SELECT * FROM t1; + } +} {1 2} + +db close +file delete -force test.db test.db-journal +sqlite3 db test.db + +do_test jrnlmode3-2.1 { + db eval { + PRAGMA locking_mode=EXCLUSIVE; + PRAGMA journal_mode=OFF; + CREATE TABLE t1(x); + INSERT INTO t1 VALUES(1); + SELECT * FROM t1; + } +} {exclusive off 1} +do_test jrnlmode3-2.2 { + db eval { + BEGIN; + INSERT INTO t1 VALUES(2); + ROLLBACK; + SELECT * FROM t1; + } +} {1 2} + + +finish_test