1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Fix an error that could occur if the first transaction executed by a connection configured to use blocking locks is a write-transaction for which the WRITER lock cannot be obtained.

FossilOrigin-Name: 49e4dc72f7a4b28e4b49d7b91030bc986aea3ff44dac38cb6e68305800cd1de5
This commit is contained in:
dan
2020-05-07 14:26:40 +00:00
parent 4cbe5d3588
commit 11a8182e5c
4 changed files with 24 additions and 11 deletions

View File

@ -78,7 +78,6 @@ db2 close
#-------------------------------------------------------------------------
do_multiclient_test tn {
do_test 2.$tn.1 {
sql1 {
PRAGMA journal_mode = wal;
@ -175,11 +174,25 @@ do_multiclient_test tn {
do_test 2.$tn.14 {
set us [lindex [time { catch {db eval "PRAGMA wal_checkpoint=RESTART"} }] 0]
puts $us
expr $us>1000000 && $us<4000000
} {1}
}
#-------------------------------------------------------------------------
reset_db
sqlite3 db2 test.db
db2 timeout 1000
do_execsql_test 3.0 {
PRAGMA journal_mode = wal;
CREATE TABLE x1(x, y);
BEGIN;
INSERT INTO x1 VALUES(1, 2);
} {wal}
do_test 3.1 {
list [catch { db2 eval {BEGIN EXCLUSIVE} } msg] $msg
} {1 {database is locked}}
finish_test