/ Check-in [0cfb8887]
Login

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

Overview
Comment:Fix an assert() that might be false for a corrupt database.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 0cfb888723fb8ff0763bbc23acb7d21a53f6d1c40661d8468248644281b29d85
User & Date: drh 2019-02-16 22:45:55
Context
2019-02-18
12:16
Fix an assert() that might not be true if the %_segdir table of FTS3 contains corrupt entries. check-in: a6509ca3 user: drh tags: trunk
2019-02-16
22:45
Fix an assert() that might be false for a corrupt database. check-in: 0cfb8887 user: drh tags: trunk
2019-02-14
15:27
Improved oversized cell detection when updating ptrmap pages in balance_nonroot(). check-in: aa61435a user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

  6726   6726       }
  6727   6727       pIns = pPage->aCellIdx + i*2;
  6728   6728       memmove(pIns+2, pIns, 2*(pPage->nCell - i));
  6729   6729       put2byte(pIns, idx);
  6730   6730       pPage->nCell++;
  6731   6731       /* increment the cell count */
  6732   6732       if( (++data[pPage->hdrOffset+4])==0 ) data[pPage->hdrOffset+3]++;
  6733         -    assert( get2byte(&data[pPage->hdrOffset+3])==pPage->nCell );
         6733  +    assert( get2byte(&data[pPage->hdrOffset+3])==pPage->nCell || CORRUPT_DB );
  6734   6734   #ifndef SQLITE_OMIT_AUTOVACUUM
  6735   6735       if( pPage->pBt->autoVacuum ){
  6736   6736         /* The cell may contain a pointer to an overflow page. If so, write
  6737   6737         ** the entry for the overflow page into the pointer map.
  6738   6738         */
  6739   6739         ptrmapPutOvflPtr(pPage, pPage, pCell, pRC);
  6740   6740       }