1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-10 01:02:56 +03:00

Rearrange some code in OP_JournalMode to avoid incorrect returns from subsequent invocations of "PRAGMA journal_mode" following an IO error.

FossilOrigin-Name: ce0a4a9b5f981d066822a9ae63740c91b35bfc60
This commit is contained in:
dan
2010-06-18 16:13:45 +00:00
parent 83acd423a1
commit d956efebea
4 changed files with 28 additions and 30 deletions

View File

@@ -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];