/ Check-in [022fdc98]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Fix a dropped error code in pager.c.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | experimental-mmap
Files: files | file ages | folders
SHA1: 022fdc986b33701abfd39621072ac3d9f9f7d43e
User & Date: dan 2013-03-15 19:13:42
Context
2013-03-16
20:19
When possible, use memcpy() to and from the mapped region instead of xWrite() and xRead(). check-in: f8ca5622 user: dan tags: experimental-mmap
2013-03-15
19:13
Fix a dropped error code in pager.c. check-in: 022fdc98 user: dan tags: experimental-mmap
18:29
Allow read-only cursors to use mmap pages even if there is an open write transaction. check-in: b387e2f9 user: dan tags: experimental-mmap
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

  5216   5216     /* If the pager is in the error state, return an error immediately. 
  5217   5217     ** Otherwise, request the page from the PCache layer. */
  5218   5218     if( pPager->errCode!=SQLITE_OK ){
  5219   5219       rc = pPager->errCode;
  5220   5220     }else{
  5221   5221   
  5222   5222       if( bMmapOk ){
  5223         -      if( pPager->pMap==0 ) rc = pagerMap(pPager);
         5223  +      if( pPager->pMap==0 ){
         5224  +        rc = pagerMap(pPager);
         5225  +      }
  5224   5226         if( rc==SQLITE_OK && pPager->nMap>=((i64)pgno * pPager->pageSize) ){
  5225   5227           if( pPager->eState>PAGER_READER ){
  5226   5228             (void)sqlite3PcacheFetch(pPager->pPCache, pgno, 0, &pPg);
  5227   5229           }
  5228   5230           if( pPg==0 ){
  5229   5231             rc = pagerAcquireMapPage(pPager, pgno, &pPg);
  5230   5232           }
  5231   5233           if( pPg ){
  5232   5234             assert( rc==SQLITE_OK );
  5233   5235             *ppPage = pPg;
  5234   5236             return SQLITE_OK;
  5235         -        }else if( rc!=SQLITE_OK ){
  5236         -          goto pager_acquire_err;
  5237   5237           }
  5238   5238         }
         5239  +      if( rc!=SQLITE_OK ){
         5240  +        goto pager_acquire_err;
         5241  +      }
  5239   5242       }
  5240   5243   
  5241   5244       rc = sqlite3PcacheFetch(pPager->pPCache, pgno, 1, ppPage);
  5242   5245     }
  5243   5246   
  5244   5247     if( rc!=SQLITE_OK ){
  5245   5248       /* Either the call to sqlite3PcacheFetch() returned an error or the