/ Check-in [7bbf9b3c]
Login

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

Overview
Comment:Instead of early detection of corruption in balance_nonroot, simply ignore the error, as it is harmless and exceedingly uncommon.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7bbf9b3cd6ebf103ebd8347579aef721d0dcd2dc
User & Date: drh 2015-05-23 19:53:48
Context
2015-05-24
10:18
Detect database corruption in the modifyPagePointer() routine and abort. check-in: 4f0bba42 user: drh tags: trunk
2015-05-23
19:53
Instead of early detection of corruption in balance_nonroot, simply ignore the error, as it is harmless and exceedingly uncommon. check-in: 7bbf9b3c user: drh tags: trunk
19:29
Earlier detection of a specific kind of corruption in the balance_nonroot() routine. check-in: ee6dc991 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

  6875   6875         iSpace1 += sz;
  6876   6876         assert( sz<=pBt->maxLocal+23 );
  6877   6877         assert( iSpace1 <= (int)pBt->pageSize );
  6878   6878         memcpy(pTemp, apDiv[i], sz);
  6879   6879         apCell[nCell] = pTemp+leafCorrection;
  6880   6880         assert( leafCorrection==0 || leafCorrection==4 );
  6881   6881         szCell[nCell] = szCell[nCell] - leafCorrection;
  6882         -      if( szCell[nCell]<3 ){
  6883         -        rc = SQLITE_CORRUPT_BKPT;
  6884         -        goto balance_cleanup;
  6885         -      }
  6886   6882         if( !pOld->leaf ){
  6887   6883           assert( leafCorrection==0 );
  6888   6884           assert( pOld->hdrOffset==0 );
  6889   6885           /* The right pointer of the child page pOld becomes the left
  6890   6886           ** pointer of the divider cell */
  6891   6887           memcpy(apCell[nCell], &pOld->aData[8], 4);
  6892   6888         }else{
  6893   6889           assert( leafCorrection==4 );
  6894   6890           if( szCell[nCell]<4 ){
  6895   6891             /* Do not allow any cells smaller than 4 bytes. If a smaller cell
  6896   6892             ** does exist, pad it with 0x00 bytes. */
  6897         -          assert( szCell[nCell]==3 );
  6898         -          assert( apCell[nCell]==&aSpace1[iSpace1-3] );
         6893  +          assert( szCell[nCell]==3 || CORRUPT_DB );
         6894  +          assert( apCell[nCell]==&aSpace1[iSpace1-3] || CORRUPT_DB );
  6899   6895             aSpace1[iSpace1++] = 0x00;
  6900   6896             szCell[nCell] = 4;
  6901   6897           }
  6902   6898         }
  6903   6899         nCell++;
  6904   6900       }
  6905   6901     }