diff options
author | mistachkin <mistachkin@noemail.net> | 2014-03-07 02:29:56 +0000 |
---|---|---|
committer | mistachkin <mistachkin@noemail.net> | 2014-03-07 02:29:56 +0000 |
commit | 8879481868f56a18f53aad35b2e9b384c52601d1 (patch) | |
tree | c8127cbb4f1c5d0246583dd7f9bd2d6d5bc1e548 /src | |
parent | f0ec2a5ea71bf981b32c61856e08917950473a1e (diff) | |
download | sqlite-8879481868f56a18f53aad35b2e9b384c52601d1.tar.gz sqlite-8879481868f56a18f53aad35b2e9b384c52601d1.zip |
Avoid calling sqlite3OsDelete() on a file that is open, since this causes Windows to run *very* slowly. Comes up on error recovery in journal_mode=PERSIST.
FossilOrigin-Name: fdc651e2ec7a0babee669e24fd56632e7cd5f0e9
Diffstat (limited to 'src')
-rw-r--r-- | src/pager.c | 12 |
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); |