1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Fix a bug in sqlite3_snapshot_recover() that could cause subsequent read

transactions to use out-of-data cache entries.

FossilOrigin-Name: 9abeb7980a34cec11a3420e14ad98a4ec0d9c599
This commit is contained in:
dan
2016-11-19 14:53:22 +00:00
parent 1158498dce
commit 5b4009f637
4 changed files with 34 additions and 8 deletions

View File

@@ -2432,7 +2432,12 @@ int sqlite3WalSnapshotRecover(Wal *pWal){
walUnlockExclusive(pWal, WAL_CKPT_LOCK, 1);
}
/* End the read transaction opened above. Also zero the cache of the
** wal-index header to force the pager-cache to be flushed when the next
** read transaction is open, as it may not match the current contents of
** pWal->hdr. */
sqlite3WalEndReadTransaction(pWal);
memset(&pWal->hdr, 0, sizeof(WalIndexHdr));
}
return rc;