mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Fix a couple of test scripts to match the new wal recovery behaviour on this branch.
FossilOrigin-Name: 3af61e83532f76f0f3252a28663415d37b096ddf05a9c58fa79303933c09abce
This commit is contained in:
@ -122,8 +122,12 @@ do_test wal2-1.1 {
|
||||
} {4 10}
|
||||
|
||||
set RECOVER [list \
|
||||
{0 1 lock exclusive} {1 2 lock exclusive} {4 4 lock exclusive} \
|
||||
{1 2 unlock exclusive} {4 4 unlock exclusive} {0 1 unlock exclusive} \
|
||||
{0 1 lock exclusive} {1 2 lock exclusive} \
|
||||
{4 1 lock exclusive} {4 1 unlock exclusive} \
|
||||
{5 1 lock exclusive} {5 1 unlock exclusive} \
|
||||
{6 1 lock exclusive} {6 1 unlock exclusive} \
|
||||
{7 1 lock exclusive} {7 1 unlock exclusive} \
|
||||
{1 2 unlock exclusive} {0 1 unlock exclusive} \
|
||||
]
|
||||
set READ [list \
|
||||
{4 1 lock shared} {4 1 unlock shared} \
|
||||
@ -394,9 +398,17 @@ set expected_locks [list]
|
||||
lappend expected_locks {1 1 lock exclusive} ;# Lock checkpoint
|
||||
lappend expected_locks {0 1 lock exclusive} ;# Lock writer
|
||||
lappend expected_locks {2 1 lock exclusive} ;# Lock recovery
|
||||
lappend expected_locks {4 4 lock exclusive} ;# Lock all aReadMark[]
|
||||
# lappend expected_locks {4 4 lock exclusive} ;# Lock all aReadMark[]
|
||||
lappend expected_locks {4 1 lock exclusive} ;# Lock aReadMark[1]
|
||||
lappend expected_locks {4 1 unlock exclusive} ;# Unlock aReadMark[1]
|
||||
lappend expected_locks {5 1 lock exclusive}
|
||||
lappend expected_locks {5 1 unlock exclusive}
|
||||
lappend expected_locks {6 1 lock exclusive}
|
||||
lappend expected_locks {6 1 unlock exclusive}
|
||||
lappend expected_locks {7 1 lock exclusive}
|
||||
lappend expected_locks {7 1 unlock exclusive}
|
||||
lappend expected_locks {2 1 unlock exclusive} ;# Unlock recovery
|
||||
lappend expected_locks {4 4 unlock exclusive} ;# Unlock all aReadMark[]
|
||||
# lappend expected_locks {4 4 unlock exclusive} ;# Unlock all aReadMark[]
|
||||
lappend expected_locks {0 1 unlock exclusive} ;# Unlock writer
|
||||
lappend expected_locks {3 1 lock exclusive} ;# Lock aReadMark[0]
|
||||
lappend expected_locks {3 1 unlock exclusive} ;# Unlock aReadMark[0]
|
||||
@ -625,8 +637,12 @@ do_test wal2-6.4.1 {
|
||||
} {}
|
||||
|
||||
set RECOVERY {
|
||||
{0 1 lock exclusive} {1 2 lock exclusive} {4 4 lock exclusive}
|
||||
{1 2 unlock exclusive} {4 4 unlock exclusive} {0 1 unlock exclusive}
|
||||
{0 1 lock exclusive} {1 2 lock exclusive}
|
||||
{4 1 lock exclusive} {4 1 unlock exclusive}
|
||||
{5 1 lock exclusive} {5 1 unlock exclusive}
|
||||
{6 1 lock exclusive} {6 1 unlock exclusive}
|
||||
{7 1 lock exclusive} {7 1 unlock exclusive}
|
||||
{1 2 unlock exclusive} {0 1 unlock exclusive}
|
||||
}
|
||||
set READMARK0_READ {
|
||||
{3 1 lock shared} {3 1 unlock shared}
|
||||
|
@ -52,18 +52,28 @@ do_test 1.1 {
|
||||
set ::locks [list]
|
||||
sqlite3 db test.db -vfs T
|
||||
execsql { SELECT * FROM x }
|
||||
lrange $::locks 0 5
|
||||
} [list {0 1 lock exclusive} {1 2 lock exclusive} {4 4 lock exclusive} \
|
||||
{1 2 unlock exclusive} {4 4 unlock exclusive} {0 1 unlock exclusive} \
|
||||
lrange $::locks 0 11
|
||||
} [list {0 1 lock exclusive} {1 2 lock exclusive} \
|
||||
{4 1 lock exclusive} {4 1 unlock exclusive} \
|
||||
{5 1 lock exclusive} {5 1 unlock exclusive} \
|
||||
{6 1 lock exclusive} {6 1 unlock exclusive} \
|
||||
{7 1 lock exclusive} {7 1 unlock exclusive} \
|
||||
{1 2 unlock exclusive} \
|
||||
{0 1 unlock exclusive} \
|
||||
]
|
||||
do_test 1.2 {
|
||||
db close
|
||||
set ::locks [list]
|
||||
sqlite3 db test.db -vfs T
|
||||
execsql { SELECT * FROM x }
|
||||
lrange $::locks 0 5
|
||||
} [list {0 1 lock exclusive} {1 2 lock exclusive} {4 4 lock exclusive} \
|
||||
{1 2 unlock exclusive} {4 4 unlock exclusive} {0 1 unlock exclusive} \
|
||||
lrange $::locks 0 11
|
||||
} [list {0 1 lock exclusive} {1 2 lock exclusive} \
|
||||
{4 1 lock exclusive} {4 1 unlock exclusive} \
|
||||
{5 1 lock exclusive} {5 1 unlock exclusive} \
|
||||
{6 1 lock exclusive} {6 1 unlock exclusive} \
|
||||
{7 1 lock exclusive} {7 1 unlock exclusive} \
|
||||
{1 2 unlock exclusive} \
|
||||
{0 1 unlock exclusive} \
|
||||
]
|
||||
proc lock_callback {method filename handle lock} {
|
||||
if {$lock == "1 2 lock exclusive"} { return SQLITE_BUSY }
|
||||
@ -101,7 +111,7 @@ do_test 1.5 {
|
||||
set ::locks [list]
|
||||
sqlite3 db test.db -vfs T
|
||||
catchsql { SELECT * FROM x }
|
||||
} {1 {locking protocol}}
|
||||
} {0 z}
|
||||
db close
|
||||
T delete
|
||||
|
||||
@ -160,7 +170,7 @@ do_test 2.5 {
|
||||
} {Tehran Qom Markazi Qazvin Gilan Ardabil}
|
||||
do_test 2.6 {
|
||||
set ::r
|
||||
} {1 {locking protocol}}
|
||||
} {0 {Tehran Qom Markazi Qazvin Gilan Ardabil}}
|
||||
|
||||
db close
|
||||
db2 close
|
||||
@ -182,7 +192,7 @@ do_test 2.7 {
|
||||
} {Tehran Qom Markazi Qazvin Gilan Ardabil}
|
||||
do_test 2.8 {
|
||||
set ::r
|
||||
} {1 {locking protocol}}
|
||||
} {0 {Tehran Qom Markazi Qazvin Gilan Ardabil}}
|
||||
|
||||
db close
|
||||
db2 close
|
||||
|
Reference in New Issue
Block a user