diff options
author | dan <dan@noemail.net> | 2018-08-31 19:00:16 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2018-08-31 19:00:16 +0000 |
commit | 8d4b7a3fa85592a0e39ada5bf56d4cc0abd4d80c (patch) | |
tree | 8459737abc369eb88d11a0d4dc51ffa0517fbc2f /src/wal.c | |
parent | 876c7ea3fa7507018df842eeb6870c1b4f5d8f38 (diff) | |
download | sqlite-8d4b7a3fa85592a0e39ada5bf56d4cc0abd4d80c.tar.gz sqlite-8d4b7a3fa85592a0e39ada5bf56d4cc0abd4d80c.zip |
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
Diffstat (limited to 'src/wal.c')
-rw-r--r-- | src/wal.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -2795,7 +2795,7 @@ int sqlite3WalBeginReadTransaction(Wal *pWal, int *pChanged){ /* Check that the wal file has not been wrapped. Assuming that it has ** not, also check that no checkpointer has attempted to checkpoint any ** frames beyond pSnapshot->mxFrame. If either of these conditions are - ** true, return SQLITE_BUSY_SNAPSHOT. Otherwise, overwrite pWal->hdr + ** true, return SQLITE_ERROR_SNAPSHOT. Otherwise, overwrite pWal->hdr ** with *pSnapshot and set *pChanged as appropriate for opening the ** snapshot. */ if( !memcmp(pSnapshot->aSalt, pWal->hdr.aSalt, sizeof(pWal->hdr.aSalt)) @@ -2805,7 +2805,7 @@ int sqlite3WalBeginReadTransaction(Wal *pWal, int *pChanged){ memcpy(&pWal->hdr, pSnapshot, sizeof(WalIndexHdr)); *pChanged = bChanged; }else{ - rc = SQLITE_BUSY_SNAPSHOT; + rc = SQLITE_ERROR_SNAPSHOT; } /* Release the shared CKPT lock obtained above. */ @@ -3802,7 +3802,7 @@ int sqlite3WalSnapshotCheck(Wal *pWal, sqlite3_snapshot *pSnapshot){ if( memcmp(pNew->aSalt, pWal->hdr.aSalt, sizeof(pWal->hdr.aSalt)) || pNew->mxFrame<walCkptInfo(pWal)->nBackfillAttempted ){ - rc = SQLITE_BUSY_SNAPSHOT; + rc = SQLITE_ERROR_SNAPSHOT; walUnlockShared(pWal, WAL_CKPT_LOCK); } } |