/ Check-in [88204085]
Login

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

Overview
Comment:Use an unsigned integer to count free pages in btree.c:freePage2().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 8820408597341344b308277ce6ef41b47c7514d6c613520789b05ee52cbedae8
User & Date: drh 2019-04-09 01:26:31
Context
2019-04-09
21:32
Improved reporting of SQLITE_TOOBIG errors while parsing. check-in: ea2d4b65 user: drh tags: trunk
20:50
Fix a problem caused by a small SQLITE_LIMIT_LENGTH value and a CREATE TABLE with a very large name. Closed-Leaf check-in: 9b5d4088 user: dan tags: toobig-fix
01:26
Use an unsigned integer to count free pages in btree.c:freePage2(). check-in: 88204085 user: drh tags: trunk
2019-04-07
18:21
Make the testcase() macro added in the previous check-in reachable for testing. check-in: 80704a16 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/btree.c.

  6166   6166   */
  6167   6167   static int freePage2(BtShared *pBt, MemPage *pMemPage, Pgno iPage){
  6168   6168     MemPage *pTrunk = 0;                /* Free-list trunk page */
  6169   6169     Pgno iTrunk = 0;                    /* Page number of free-list trunk page */ 
  6170   6170     MemPage *pPage1 = pBt->pPage1;      /* Local reference to page 1 */
  6171   6171     MemPage *pPage;                     /* Page being freed. May be NULL. */
  6172   6172     int rc;                             /* Return Code */
  6173         -  int nFree;                          /* Initial number of pages on free-list */
         6173  +  u32 nFree;                          /* Initial number of pages on free-list */
  6174   6174   
  6175   6175     assert( sqlite3_mutex_held(pBt->mutex) );
  6176   6176     assert( CORRUPT_DB || iPage>1 );
  6177   6177     assert( !pMemPage || pMemPage->pgno==iPage );
  6178   6178   
  6179   6179     if( iPage<2 || iPage>pBt->nPage ){
  6180   6180       return SQLITE_CORRUPT_BKPT;