mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Do not delete the journal file in "PRAGMA journal_mode" commands. This fixes [fc62af4523].
FossilOrigin-Name: 1ec74591a93e8b27ad3ac739914a48a91972e82c
This commit is contained in:
14
src/pager.c
14
src/pager.c
@@ -5877,20 +5877,6 @@ int sqlite3PagerSetJournalMode(Pager *pPager, int eMode){
|
||||
|
||||
/* Change the journal mode. */
|
||||
pPager->journalMode = (u8)eMode;
|
||||
|
||||
/* When transistioning from TRUNCATE or PERSIST to any other journal
|
||||
** mode (and we are not in locking_mode=EXCLUSIVE) then delete the
|
||||
** journal file.
|
||||
*/
|
||||
assert( (PAGER_JOURNALMODE_TRUNCATE & 5)==1 );
|
||||
assert( (PAGER_JOURNALMODE_PERSIST & 5)==1 );
|
||||
assert( (PAGER_JOURNALMODE_DELETE & 5)!=1 );
|
||||
assert( (PAGER_JOURNALMODE_MEMORY & 5)!=1 );
|
||||
assert( (PAGER_JOURNALMODE_OFF & 5)!=1 );
|
||||
assert( (PAGER_JOURNALMODE_WAL & 5)!=1 );
|
||||
if( (eOld & 5)==1 && (eMode & 5)!=1 && !pPager->exclusiveMode ){
|
||||
sqlite3OsDelete(pPager->pVfs, pPager->zJournal, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Return the new journal mode */
|
||||
|
Reference in New Issue
Block a user