1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

It turns out that pagerExclusiveLock() can be called with the lock state

already set to RESERVED if the SQLITE_FCNTL_PERSIST_WAL setting is set and
a specific sequence of multiple journal mode changes occur.
Enhance pagerExclusiveLock() to deal with this.
[forum:/forumpost/8130545bc6|Forum post 8130545bc6]

FossilOrigin-Name: 2bb8d977392f635515aa4a36f6f763a2e4858f7adc1120519e2e74c04a9749b5
This commit is contained in:
drh
2023-05-07 03:23:32 +00:00
parent 4e73863fd4
commit 28f32bedd1
4 changed files with 29 additions and 11 deletions

View File

@ -121,6 +121,22 @@ do_test walpersist-3.4 {
sqlite3 db test.db
execsql { PRAGMA integrity_check }
} {ok}
# 2023-05-07 https://sqlite.org/forum/forumpost/8130545bc6
#
reset_db
do_test 4.1 {
db eval {
PRAGMA journal_mode=WAL;
CREATE TABLE t1(x);
}
file_control_persist_wal db 1
db eval {
PRAGMA journal_mode=TRUNCATE;
PRAGMA journal_mode=MEMORY;
PRAGMA journal_mode=WAL;
PRAGMA journal_mode=PERSIST;
}
} {truncate memory wal persist}
finish_test