Remove an unnecessary branch from wal.c.

FossilOrigin-Name: 8e54786c9a0c5c399f228f56c73271f84d75694b
This commit is contained in:
dan
2010-06-04 17:16:52 +00:00
parent 0dc7b74fbe
commit 0153a9bc04
4 changed files with 25 additions and 11 deletions
+17 -1
View File
@@ -262,7 +262,11 @@ foreach {tn syncmode synccount} {
# When recovering the contents of a WAL file, a process obtains the WRITER
# lock, then locks all other bytes before commencing recovery. If it fails
# to lock all other bytes (because some other process is holding a read
# lock) it should return SQLITE_BUSY to the caller. Test this.
# lock) it should retry up to 100 times. Then return SQLITE_PROTOCOL to the
# caller. Test this (test case wal3-4.3).
#
# Also test the effect of hitting an SQLITE_BUSY while attempting to obtain
# the WRITER lock (should be the same). Test case wal3-4.4.
#
proc lock_callback {method filename handle lock} {
lappend ::locks $lock
@@ -301,6 +305,18 @@ do_test wal3-4.3 {
catchsql { SELECT * FROM x }
} {1 {locking protocol}}
puts " Warning: Same again!"
proc lock_callback {method filename handle lock} {
if {$lock == "0 1 lock exclusive"} { return SQLITE_BUSY }
return SQLITE_OK
}
do_test wal3-4.4 {
db close
set ::locks [list]
sqlite3 db test.db -vfs T
catchsql { SELECT * FROM x }
} {1 {locking protocol}}
db close
T delete