/ Check-in [8097712c]
Login

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

Overview
Comment:Improved detection of cells that extend into the reserved space at the end of the page while adjusting overflow page pointers during autovacuum.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8097712c9c1f4ea16bc5dd462da248ef98896061
User & Date: drh 2017-01-12 15:11:03
Context
2017-01-12
16:14
Remove an unnecessary corruption test from the btree balancer. If corruption is present, it will be found harmlessly by later tests. check-in: bddf3956 user: drh tags: trunk
15:19
Test case macros to show that the previous check-in is well tested. Leaf check-in: bd8b977a user: drh tags: extra-testcase-macros
15:11
Improved detection of cells that extend into the reserved space at the end of the page while adjusting overflow page pointers during autovacuum. check-in: 8097712c user: drh tags: trunk
11:52
Remove invalid test case from cursorhints2.test check-in: 163cc1b2 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

  3352   3352       nCell = pPage->nCell;
  3353   3353   
  3354   3354       for(i=0; i<nCell; i++){
  3355   3355         u8 *pCell = findCell(pPage, i);
  3356   3356         if( eType==PTRMAP_OVERFLOW1 ){
  3357   3357           CellInfo info;
  3358   3358           pPage->xParseCell(pPage, pCell, &info);
  3359         -        if( info.nLocal<info.nPayload
  3360         -         && pCell+info.nSize-1<=pPage->aData+pPage->maskPage
  3361         -         && iFrom==get4byte(pCell+info.nSize-4)
  3362         -        ){
  3363         -          put4byte(pCell+info.nSize-4, iTo);
  3364         -          break;
         3359  +        if( info.nLocal<info.nPayload ){
         3360  +          if( pCell+info.nSize > pPage->aData+pPage->pBt->usableSize ){
         3361  +            return SQLITE_CORRUPT_BKPT;
         3362  +          }
         3363  +          if( iFrom==get4byte(pCell+info.nSize-4) ){
         3364  +            put4byte(pCell+info.nSize-4, iTo);
         3365  +            break;
         3366  +          }
  3365   3367           }
  3366   3368         }else{
  3367   3369           if( get4byte(pCell)==iFrom ){
  3368   3370             put4byte(pCell, iTo);
  3369   3371             break;
  3370   3372           }
  3371   3373         }