/ 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 Unified Diffs Show Whitespace Changes Patch

Changes to src/btree.c.

3352
3353
3354
3355
3356
3357
3358
3359
3360


3361
3362
3363
3364
3365

3366
3367
3368
3369
3370
3371
3372
    nCell = pPage->nCell;

    for(i=0; i<nCell; i++){
      u8 *pCell = findCell(pPage, i);
      if( eType==PTRMAP_OVERFLOW1 ){
        CellInfo info;
        pPage->xParseCell(pPage, pCell, &info);
        if( info.nLocal<info.nPayload
         && pCell+info.nSize-1<=pPage->aData+pPage->maskPage


         && iFrom==get4byte(pCell+info.nSize-4)
        ){
          put4byte(pCell+info.nSize-4, iTo);
          break;
        }

      }else{
        if( get4byte(pCell)==iFrom ){
          put4byte(pCell, iTo);
          break;
        }
      }
    }







|
|
>
>
|
<



>







3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363

3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
    nCell = pPage->nCell;

    for(i=0; i<nCell; i++){
      u8 *pCell = findCell(pPage, i);
      if( eType==PTRMAP_OVERFLOW1 ){
        CellInfo info;
        pPage->xParseCell(pPage, pCell, &info);
        if( info.nLocal<info.nPayload ){
          if( pCell+info.nSize > pPage->aData+pPage->pBt->usableSize ){
            return SQLITE_CORRUPT_BKPT;
          }
          if( iFrom==get4byte(pCell+info.nSize-4) ){

            put4byte(pCell+info.nSize-4, iTo);
            break;
          }
        }
      }else{
        if( get4byte(pCell)==iFrom ){
          put4byte(pCell, iTo);
          break;
        }
      }
    }