/ Check-in [82b38fca]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Minor tweaks to get the pager working for corner cases when the SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN flag is set.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:82b38fca1aea345ade954517661145f1859e701c
User & Date: drh 2010-06-21 21:45:37
Context
2010-06-22
11:10
Fix problem with handling of -vfs option in tcl interface. check-in: 8f98e8b5 user: dan tags: trunk
2010-06-21
21:45
Minor tweaks to get the pager working for corner cases when the SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN flag is set. check-in: 82b38fca user: drh tags: trunk
20:19
Fix comment inside the pager_unlock() routine. Always close the master journal file before trying to delete it. check-in: f820b815 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

  2572   2572         nJRec = (u32)((szJ - pPager->journalOff)/JOURNAL_PG_SZ(pPager));
  2573   2573       }
  2574   2574       for(ii=0; rc==SQLITE_OK && ii<nJRec && pPager->journalOff<szJ; ii++){
  2575   2575         rc = pager_playback_one_page(pPager, &pPager->journalOff, pDone, 1, 1);
  2576   2576       }
  2577   2577       assert( rc!=SQLITE_DONE );
  2578   2578     }
  2579         -  assert( rc!=SQLITE_OK || pPager->journalOff==szJ );
         2579  +  assert( rc!=SQLITE_OK || pPager->journalOff>=szJ );
  2580   2580   
  2581   2581     /* Finally,  rollback pages from the sub-journal.  Page that were
  2582   2582     ** previously rolled back out of the main journal (and are hence in pDone)
  2583   2583     ** will be skipped.  Out-of-range pages are also skipped.
  2584   2584     */
  2585   2585     if( pSavepoint ){
  2586   2586       u32 ii;            /* Loop counter */
................................................................................
  4703   4703       ** which means they have acquired the necessary locks but the rollback
  4704   4704       ** journal might not yet be open.
  4705   4705       */
  4706   4706       rc = sqlite3PagerBegin(pPager, 0, pPager->subjInMemory);
  4707   4707       if( rc!=SQLITE_OK ){
  4708   4708         return rc;
  4709   4709       }
  4710         -    if( !isOpen(pPager->jfd) 
         4710  +    if( pPager->pInJournal==0
  4711   4711        && pPager->journalMode!=PAGER_JOURNALMODE_OFF 
  4712   4712        && !pagerUseWal(pPager)
  4713   4713       ){
  4714   4714         assert( pPager->useJournal );
  4715   4715         rc = pager_open_journal(pPager);
  4716   4716         if( rc!=SQLITE_OK ) return rc;
  4717   4717       }