diff options
author | dan <dan@noemail.net> | 2011-01-11 16:09:55 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2011-01-11 16:09:55 +0000 |
commit | 9f4beedb6fcff907e90a5a2ba4d8c3fe3f9af27d (patch) | |
tree | 361fd6e474ca1e3cca23d43df83e670b618d54d1 /src/pager.c | |
parent | bbd91944dd7fca17d19afe43ee9e5e982bf58b3a (diff) | |
download | sqlite-9f4beedb6fcff907e90a5a2ba4d8c3fe3f9af27d.tar.gz sqlite-9f4beedb6fcff907e90a5a2ba4d8c3fe3f9af27d.zip |
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
Diffstat (limited to 'src/pager.c')
-rw-r--r-- | src/pager.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/pager.c b/src/pager.c index 5fcee322b..a4773e230 100644 --- a/src/pager.c +++ b/src/pager.c @@ -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); } |