aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pager.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pager.c b/src/pager.c
index b6cd93b72..6a4746e34 100644
--- a/src/pager.c
+++ b/src/pager.c
@@ -4889,15 +4889,15 @@ static int hasHotJournal(Pager *pPager, int *pExists){
if( rc==SQLITE_OK && !locked ){
Pgno nPage; /* Number of pages in database file */
- /* Check the size of the database file. If it consists of 0 pages,
- ** then delete the journal file. See the header comment above for
- ** the reasoning here. Delete the obsolete journal file under
- ** a RESERVED lock to avoid race conditions and to avoid violating
- ** [H33020].
+ /* Check the size of the database file. If it consists of 0 pages
+ ** and the journal is not being persisted, then delete the journal
+ ** file. See the header comment above for the reasoning here.
+ ** Delete the obsolete journal file under a RESERVED lock to avoid
+ ** race conditions and to avoid violating [H33020].
*/
rc = pagerPagecount(pPager, &nPage);
if( rc==SQLITE_OK ){
- if( nPage==0 ){
+ if( nPage==0 && pPager->journalMode!=PAGER_JOURNALMODE_PERSIST ){
sqlite3BeginBenignMalloc();
if( pagerLockDb(pPager, RESERVED_LOCK)==SQLITE_OK ){
sqlite3OsDelete(pVfs, pPager->zJournal, 0);