diff options
author | dan <dan@noemail.net> | 2010-06-18 16:13:45 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2010-06-18 16:13:45 +0000 |
commit | d956efebeaaf7b724c141b765a95a79932b7b538 (patch) | |
tree | bbc7701bdd3ec210d5115ca9d1e969db7007df45 /src | |
parent | 83acd423a1bca7c95cae4a4c9af918e3ebc00d59 (diff) | |
download | sqlite-d956efebeaaf7b724c141b765a95a79932b7b538.tar.gz sqlite-d956efebeaaf7b724c141b765a95a79932b7b538.zip |
Rearrange some code in OP_JournalMode to avoid incorrect returns from subsequent invocations of "PRAGMA journal_mode" following an IO error.
FossilOrigin-Name: ce0a4a9b5f981d066822a9ae63740c91b35bfc60
Diffstat (limited to 'src')
-rw-r--r-- | src/vdbe.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/vdbe.c b/src/vdbe.c index 6803beafd..aec5712bf 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -5248,8 +5248,6 @@ case OP_JournalMode: { /* out2-prerelease */ rc = sqlite3PagerCloseWal(pPager); if( rc==SQLITE_OK ){ sqlite3PagerSetJournalMode(pPager, eNew); - }else if( rc==SQLITE_BUSY && pOp->p5==0 ){ - goto abort_due_to_error; } } @@ -5259,16 +5257,15 @@ case OP_JournalMode: { /* out2-prerelease */ assert( sqlite3BtreeIsInTrans(pBt)==0 ); if( rc==SQLITE_OK ){ rc = sqlite3BtreeSetVersion(pBt, (eNew==PAGER_JOURNALMODE_WAL ? 2 : 1)); - if( rc==SQLITE_BUSY && pOp->p5==0 ) goto abort_due_to_error; - } - if( rc==SQLITE_BUSY ){ - eNew = eOld; - rc = SQLITE_OK; } } } #endif /* ifndef SQLITE_OMIT_WAL */ + if( rc ){ + if( rc==SQLITE_BUSY && pOp->p5!=0 ) rc = SQLITE_OK; + eNew = eOld; + } eNew = sqlite3PagerSetJournalMode(pPager, eNew); pOut = &aMem[pOp->p2]; |