/ Check-in [4d4fb197]
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:Do not record a page-size change if the attempt to change the page size failed due to an OOM error.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4d4fb197dc438a486cf5d967cf435f1132902c63
User & Date: drh 2014-09-06 03:38:51
Original Comment: Do not require a page-size change if the attempt to change the page size failed due to an OOM error.
Context
2014-09-06
16:39
Fix typos in comments. No code changes. check-in: e62aab5e user: peter.d.reid tags: trunk
03:38
Do not record a page-size change if the attempt to change the page size failed due to an OOM error. check-in: 4d4fb197 user: drh tags: trunk
03:16
Add the sqlite3_memdebug_title_count global variable, used during debugging to count the number of invocations of test_memdebug_settitle. By examining this variable in the debugger after a segfault, one can then set a breakpoint on test_memdebug_settitle that will fire just before the problem. check-in: 27e3ca3e user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

  3614   3614       if( rc==SQLITE_OK ){
  3615   3615         pNew = (char *)sqlite3PageMalloc(pageSize);
  3616   3616         if( !pNew ) rc = SQLITE_NOMEM;
  3617   3617       }
  3618   3618   
  3619   3619       if( rc==SQLITE_OK ){
  3620   3620         pager_reset(pPager);
  3621         -      pPager->dbSize = (Pgno)((nByte+pageSize-1)/pageSize);
  3622         -      pPager->pageSize = pageSize;
  3623   3621         sqlite3PageFree(pPager->pTmpSpace);
  3624   3622         pPager->pTmpSpace = pNew;
  3625   3623         rc = sqlite3PcacheSetPageSize(pPager->pPCache, pageSize);
  3626   3624       }
         3625  +    if( rc==SQLITE_OK ){
         3626  +      pPager->dbSize = (Pgno)((nByte+pageSize-1)/pageSize);
         3627  +      pPager->pageSize = pageSize;
         3628  +    }
  3627   3629     }
  3628   3630   
  3629   3631     *pPageSize = pPager->pageSize;
  3630   3632     if( rc==SQLITE_OK ){
  3631   3633       if( nReserve<0 ) nReserve = pPager->nReserve;
  3632   3634       assert( nReserve>=0 && nReserve<1000 );
  3633   3635       pPager->nReserve = (i16)nReserve;