]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Added TCL test case for converting to WAL mode with multiple connections.
authorshaneh <shaneh@noemail.net>
Wed, 1 Dec 2010 20:49:42 +0000 (20:49 +0000)
committershaneh <shaneh@noemail.net>
Wed, 1 Dec 2010 20:49:42 +0000 (20:49 +0000)
Added exception to the test case for Windows for not being able to delete the open journal file.

FossilOrigin-Name: 7061601f4935af483f4068d257d6f8a9c728fd33

configure [changed mode: 0755->0644]
install-sh [changed mode: 0755->0644]
manifest
manifest.uuid
test/wal6.test [new file with mode: 0644]

old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index b03b39532f772b8278b19332fafb48832b82b4b8..11454b8eaa79a152477dc7420c5583e5efa4b84d 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Change\sthe\stype\sof\sa\svariable\sin\sstruct\sSrcList\sso\sthat\sit\sfits\sin\sa\s100\sbyte\slookaside\sbuffer\son\sa\s64-bit\sarchitecture.
-D 2010-12-01T19:00:48
+C Added\sTCL\stest\scase\sfor\sconverting\sto\sWAL\smode\swith\smultiple\sconnections.\s\s\nAdded\sexception\sto\sthe\stest\scase\sfor\sWindows\sfor\snot\sbeing\sable\sto\sdelete\sthe\sopen\sjournal\sfile.
+D 2010-12-01T20:49:42
 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
 F Makefile.in 4547616ad2286053af6ccccefa242dc925e49bf0
 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -22,7 +22,7 @@ F art/src_logo.gif 9341ef09f0e53cd44c0c9b6fc3c16f7f3d6c2ad9
 F config.guess 226d9a188c6196f3033ffc651cbc9dcee1a42977
 F config.h.in 868fdb48c028421a203470e15c69ada15b9ba673
 F config.sub 9ebe4c3b3dab6431ece34f16828b594fb420da55
-F configure daed6cfdb4c1449a4335b3eeddc0d836e33fb54e x
+F configure daed6cfdb4c1449a4335b3eeddc0d836e33fb54e
 F configure.ac 699040cc9abb7465dca5a2972bc89d227fd8f734
 F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
 F doc/lemon.html f0f682f50210928c07e562621c3b7e8ab912a538
@@ -97,7 +97,7 @@ F ext/rtree/rtree_util.tcl 06aab2ed5b826545bf215fff90ecb9255a8647ea
 F ext/rtree/sqlite3rtree.h 1af0899c63a688e272d69d8e746f24e76f10a3f0
 F ext/rtree/tkt3363.test 142ab96eded44a3615ec79fba98c7bde7d0f96de
 F ext/rtree/viewrtree.tcl eea6224b3553599ae665b239bd827e182b466024
-F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
+F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895
 F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
 F main.mk 05d0f3475dd331896bd607cfb45c5e21b94589ad
 F mkdll.sh 7d09b23c05d56532e9d44a50868eb4b12ff4f74a
@@ -833,6 +833,7 @@ F test/wal.test 70227190e713b3e7eb2a7d5ec3510b66db01f327
 F test/wal2.test 3de797854de175323e7351b5f2514a30d1ee1410
 F test/wal3.test ac51126c36814bce334f66a0a4dbbfa56d429733
 F test/wal4.test 3404b048fa5e10605facaf70384e6d2943412e30
+F test/wal6.test 07aa31ca8892d0527f2c5c5a9a2a87aa421dfaa8
 F test/wal_common.tcl 895d76138043b86bdccf36494054bdabcf65837b
 F test/walbak.test 4df1c7369da0301caeb9a48fa45997fd592380e4
 F test/walbig.test e882bc1d014afffbfa2b6ba36e0f07d30a633ad0
@@ -892,7 +893,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P c7771c0b22f2b45a47070cf84b9ecf1011e40404
-R 22c229b9d69b45b89e7c33c525b6a0ed
-U dan
-Z 92bb18f7bd9a0390422e9261529a2255
+P 7df43f4892e628ecb8a83c5ed2dce5e24f6dd529
+R 962ed990d1074944b6bf7c242b1c4bd6
+U shaneh
+Z 0fe38ffa95ac575a7b27d8a0b1441aa7
index ec1d723eda9853be4e017b72463b7770f86e8d02..e9a18657a3479d51b07109f61d7ca10e4eca3549 100644 (file)
@@ -1 +1 @@
-7df43f4892e628ecb8a83c5ed2dce5e24f6dd529
\ No newline at end of file
+7061601f4935af483f4068d257d6f8a9c728fd33
\ No newline at end of file
diff --git a/test/wal6.test b/test/wal6.test
new file mode 100644 (file)
index 0000000..6fae48e
--- /dev/null
@@ -0,0 +1,90 @@
+# 2010 December 1
+#
+# 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.
+#
+#***********************************************************************
+# This file implements regression tests for SQLite library.  The
+# focus of this file is testing the operation of the library in
+# "PRAGMA journal_mode=WAL" mode.
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+source $testdir/lock_common.tcl
+source $testdir/wal_common.tcl
+source $testdir/malloc_common.tcl
+ifcapable !wal {finish_test ; return }
+
+#-------------------------------------------------------------------------
+# Changing to WAL mode in one connection forces the change in others.
+#
+db close
+forcedelete test.db
+
+set all_journal_modes {delete persist truncate memory off}
+foreach jmode $all_journal_modes {
+
+       do_test wal6-1.0.$jmode {
+    sqlite3 db test.db
+    execsql "PRAGMA journal_mode = $jmode;"
+       } $jmode
+
+       do_test wal6-1.1.$jmode {
+         execsql {
+           CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
+           INSERT INTO t1 VALUES(1,2);
+           SELECT * FROM t1;
+         }
+       } {1 2}
+
+# Under Windows, you'll get an error trying to delete
+# a file this is already opened.  For now, make sure 
+# we get that error, then close the first connection
+# so the other tests work.
+if {$tcl_platform(platform)=="windows"} {
+  if {$jmode=="persist" || $jmode=="truncate"} {
+         do_test wal6-1.2.$jmode.win {
+           sqlite3 db2 test.db
+           catchsql {
+                   PRAGMA journal_mode=WAL;
+           } db2
+         } {1 {disk I/O error}}
+       db2 close
+         db close
+  }
+}
+
+       do_test wal6-1.2.$jmode {
+         sqlite3 db2 test.db
+         execsql {
+               PRAGMA journal_mode=WAL;
+               INSERT INTO t1 VALUES(3,4);
+               SELECT * FROM t1 ORDER BY a;
+         } db2
+       } {wal 1 2 3 4}
+
+if {$tcl_platform(platform)=="windows"} {
+  if {$jmode=="persist" || $jmode=="truncate"} {
+         sqlite3 db test.db
+  }
+}
+
+       do_test wal6-1.3.$jmode {
+         execsql {
+                 SELECT * FROM t1 ORDER BY a;
+         }
+       } {1 2 3 4}
+
+       db close
+       db2 close
+  forcedelete test.db
+
+}
+
+finish_test
+