/ Check-in [b3179379]
Login

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

Overview
Comment:Avoid the need for a NEVER() from pager_write_pagelist() by passing in pPager as an extra parameter.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b3179379437dbcb1d8e7f1f8f631a3e7df1a5c9a
User & Date: drh 2010-07-07 14:19:14
Context
2010-07-07
14:33
Fix a compiler warning in PRAGMA journal_mode. check-in: d94269e6 user: drh tags: trunk
14:19
Avoid the need for a NEVER() from pager_write_pagelist() by passing in pPager as an extra parameter. check-in: b3179379 user: drh tags: trunk
14:00
Merge together the accident fork. check-in: cdcf08cb user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

  3324   3324   ** in Pager.dbFileVers[] is updated to match the new value stored in
  3325   3325   ** the database file.
  3326   3326   **
  3327   3327   ** If everything is successful, SQLITE_OK is returned. If an IO error 
  3328   3328   ** occurs, an IO error code is returned. Or, if the EXCLUSIVE lock cannot
  3329   3329   ** be obtained, SQLITE_BUSY is returned.
  3330   3330   */
  3331         -static int pager_write_pagelist(PgHdr *pList){
  3332         -  Pager *pPager;                       /* Pager object */
         3331  +static int pager_write_pagelist(Pager *pPager, PgHdr *pList){
  3333   3332     int rc;                              /* Return code */
  3334   3333   
  3335         -  if( NEVER(pList==0) ) return SQLITE_OK;
  3336         -  pPager = pList->pPager;
  3337         -
  3338   3334     /* At this point there may be either a RESERVED or EXCLUSIVE lock on the
  3339   3335     ** database file. If there is already an EXCLUSIVE lock, the following
  3340   3336     ** call is a no-op.
  3341   3337     **
  3342   3338     ** Moving the lock from RESERVED to EXCLUSIVE actually involves going
  3343   3339     ** through an intermediate state PENDING.   A PENDING lock prevents new
  3344   3340     ** readers from attaching to the database but is unsufficient for us to
................................................................................
  3347   3343     **
  3348   3344     ** While the pager is in the RESERVED state, the original database file
  3349   3345     ** is unchanged and we can rollback without having to playback the
  3350   3346     ** journal into the original database file.  Once we transition to
  3351   3347     ** EXCLUSIVE, it means the database file has been changed and any rollback
  3352   3348     ** will require a journal playback.
  3353   3349     */
  3354         -  assert( !pagerUseWal(pList->pPager) );
         3350  +  assert( !pagerUseWal(pPager) );
  3355   3351     assert( pPager->state>=PAGER_RESERVED );
  3356   3352     rc = pager_wait_on_lock(pPager, EXCLUSIVE_LOCK);
  3357   3353   
  3358   3354     /* If the file is a temp-file has not yet been opened, open it now. It
  3359   3355     ** is not possible for rc to be other than SQLITE_OK if this branch
  3360   3356     ** is taken, as pager_wait_on_lock() is a no-op for temp-files.
  3361   3357     */
................................................................................
  3592   3588           rc==SQLITE_OK && pPg->pgno>pPager->dbSize && subjRequiresPage(pPg)
  3593   3589       ) ){
  3594   3590         rc = subjournalPage(pPg);
  3595   3591       }
  3596   3592     
  3597   3593       /* Write the contents of the page out to the database file. */
  3598   3594       if( rc==SQLITE_OK ){
  3599         -      rc = pager_write_pagelist(pPg);
         3595  +      rc = pager_write_pagelist(pPager, pPg);
  3600   3596       }
  3601   3597     }
  3602   3598   
  3603   3599     /* Mark the page as clean. */
  3604   3600     if( rc==SQLITE_OK ){
  3605   3601       PAGERTRACE(("STRESS %d page %d\n", PAGERID(pPager), pPg->pgno));
  3606   3602       sqlite3PcacheMakeClean(pPg);
................................................................................
  5221   5217         ** used, this call will not create the journal file or perform any
  5222   5218         ** real IO.
  5223   5219         */
  5224   5220         rc = syncJournal(pPager);
  5225   5221         if( rc!=SQLITE_OK ) goto commit_phase_one_exit;
  5226   5222     
  5227   5223         /* Write all dirty pages to the database file. */
  5228         -      rc = pager_write_pagelist(sqlite3PcacheDirtyList(pPager->pPCache));
         5224  +      rc = pager_write_pagelist(pPager,sqlite3PcacheDirtyList(pPager->pPCache));
  5229   5225         if( rc!=SQLITE_OK ){
  5230   5226           assert( rc!=SQLITE_IOERR_BLOCKED );
  5231   5227           goto commit_phase_one_exit;
  5232   5228         }
  5233   5229         sqlite3PcacheCleanAll(pPager->pPCache);
  5234   5230     
  5235   5231         /* If the file on disk is not the same size as the database image,