1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

If a rollback is attempted in journal_mode=off mode, force SQLite to discard the contents of the pager cache before processing any subsequent queries.

FossilOrigin-Name: ece7efce2733b4fdd71db385abebbde464ac8f30
This commit is contained in:
dan
2011-01-11 16:09:55 +00:00
parent bbd91944dd
commit 9f4beedb6f
6 changed files with 21 additions and 21 deletions

View File

@@ -5926,7 +5926,17 @@ int sqlite3PagerRollback(Pager *pPager){
rc2 = pager_end_transaction(pPager, pPager->setMaster);
if( rc==SQLITE_OK ) rc = rc2;
}else if( !isOpen(pPager->jfd) || pPager->eState==PAGER_WRITER_LOCKED ){
int eState = pPager->eState;
rc = pager_end_transaction(pPager, 0);
if( !MEMDB && eState>PAGER_WRITER_LOCKED ){
/* This can happen using journal_mode=off. Move the pager to the error
** state to indicate that the contents of the cache may not be trusted.
** Any active readers will get SQLITE_ABORT.
*/
pPager->errCode = SQLITE_ABORT;
pPager->eState = PAGER_ERROR;
return rc;
}
}else{
rc = pager_playback(pPager, 0);
}