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

If a call to sqlite3_snapshot_open() fails because the requested snapshot no

longer exists, return SQLITE_ERROR_SNAPSHOT instead of SQLITE_BUSY_SNAPSHOT.

FossilOrigin-Name: e07923128bb164efbafde29d49175b61f2ef44b2dfac5ae4ed61937945dfcf4c
This commit is contained in:
dan
2018-08-31 19:00:16 +00:00
parent 876c7ea3fa
commit 8d4b7a3fa8
9 changed files with 32 additions and 30 deletions

View File

@ -258,7 +258,7 @@ foreach {tn tcl} {
} {}
#-------------------------------------------------------------------------
# Check that SQLITE_BUSY_SNAPSHOT is returned if the specified snapshot
# Check that SQLITE_ERROR_SNAPSHOT is returned if the specified snapshot
# no longer exists because the wal file has been checkpointed.
#
# 1. Reading a snapshot from the middle of a wal file is not possible
@ -296,7 +296,7 @@ foreach {tn tcl} {
BEGIN;
}
list [catch {snapshot_open db main $snapshot} msg] $msg
} {1 SQLITE_BUSY_SNAPSHOT}
} {1 SQLITE_ERROR_SNAPSHOT}
do_test $tn.4.1.4 {
snapshot_free $snapshot
execsql COMMIT
@ -327,7 +327,7 @@ foreach {tn tcl} {
BEGIN;
}
list [catch {snapshot_open db main $snapshot} msg] $msg
} {1 SQLITE_BUSY_SNAPSHOT}
} {1 SQLITE_ERROR_SNAPSHOT}
do_test $tn.4.2.4 {
snapshot_free $snapshot
} {}