-C Merge\stwo\s"wal"\nleaves.
-D 2010-04-28T17:49:57
+C Add\sa\stest\sto\swalthread.test\sfor\schanging\sbetween\sWAL\sand\srollback\smodes.
+D 2010-04-28T18:17:23
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in d83a0ffef3dcbfb08b410a6c6dd6c009ec9167fb
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
F test/walhook.test 287a69d662939604f2e0452dace2cec8ef634d5e
F test/walmode.test 40119078da084e6a7403ba57485d5a86ee0e2646
F test/walslow.test 38076d5fad49e3678027be0f8110e6a32d531dc2
-F test/walthread.test 871aeecc5b89133b094bcc00c4fcfa040749c726
+F test/walthread.test ce1d0fc9905cf8a7cf1a61dbcafcbd3434166236
F test/where.test de337a3fe0a459ec7c93db16a519657a90552330
F test/where2.test 45eacc126aabb37959a387aa83e59ce1f1f03820
F test/where3.test aa44a9b29e8c9f3d7bb94a3bb3a95b31627d520d
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P 25f85f68723e56c18e44b094d85f67b99912dc86 348409de26eafe12f5cb1236e8e167a4183d4051
-R 39134c2ac17dc2dba6c744dfce94f1bb
+P 13d2d5a66e9eaa81aa6314354201ee1fbd2b3824
+R 03ea219fce1817690b6cb9bee0a76d8a
U dan
-Z 83204dbbb275bd731c15521fddcf192e
+Z e37b4277b60d879edbf1e6cb6d434b3c
# -processes BOOLEAN True to use processes instead of threads.
#
proc do_thread_test {args} {
+
+ #if {[string match walthread-2* [lindex $args 0]]==0} return
+
set A $args
set P(testname) [lshift A]
set ::finished 0
after [expr %SECONDS% * 1000] {set ::finished 1}
- proc tt_continue {} { expr ($::finished==0) }
+ proc tt_continue {} { update ; expr ($::finished==0) }
set rc [catch { %TEST% } msg]
- db close
+ catch { db close }
list $rc $msg
}]
# Each of the N threads runs N read transactions followed by a single write
# transaction in a loop as fast as possible.
#
-# Ther is also a single checkpointer thread. It runs the following loop:
+# There is also a single checkpointer thread. It runs the following loop:
#
# 1) Execute "PRAGMA checkpoint"
# 2) Sleep for 500 ms.
while {[tt_continue]} {
read_transaction
write_transaction
- usleep 1
incr nRun
}
set nRun
}
}
+#--------------------------------------------------------------------------
+#
+foreach {mode name} {
+ 0 walthread-2-threads
+ 1 walthread-2-processes
+} {
+ do_thread_test $name -processes $mode -seconds $SECONDS -init {
+ execsql { CREATE TABLE t1(x INTEGER PRIMARY KEY, y UNIQUE) }
+ } -thread RB 2 {
+
+ db close
+ set nRun 0
+ set nDel 0
+ while {[tt_continue]} {
+ sqlite3 db test.db
+ db busy busyhandler
+ db eval { SELECT * FROM sqlite_master }
+ catch { db eval { PRAGMA journal_mode = DELETE } }
+ db eval {
+ BEGIN;
+ INSERT INTO t1 VALUES(NULL, randomblob(100+$tid));
+ }
+ incr nRun 1
+ incr nDel [file exists test.db-journal]
+ db eval COMMIT
+
+ set ic [db eval {PRAGMA integrity_check}]
+ if {$ic != "ok"} { error $ic }
+ db close
+ }
+ list $nRun $nDel
+
+ } -thread WAL 2 {
+ db close
+ set nRun 0
+ set nWal 0
+ while {[tt_continue]} {
+ sqlite3 db test.db
+ db busy busyhandler
+ db eval { SELECT * FROM sqlite_master }
+ catch { db eval { PRAGMA journal_mode = WAL } }
+ db eval {
+ BEGIN;
+ INSERT INTO t1 VALUES(NULL, randomblob(110+$tid));
+ }
+ incr nRun 1
+ incr nWal [file exists test.db-wal]
+ db eval COMMIT
+
+ set ic [db eval {PRAGMA integrity_check}]
+ if {$ic != "ok"} { error $ic }
+ db close
+ }
+ list $nRun $nWal
+ }
+}
+
finish_test