/ Check-in [29f7227f]
Login

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

Overview
Comment:Fix an assert() in btree.c that is only true for non-corrupt databases.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 29f7227ff127202c53fe7c3b6558b3c101b0a7bc
User & Date: drh 2015-09-30 14:19:08
Context
2015-09-30
14:30
Add a corrupt database to test/fuzzdata3.db to validate the previous check-in. check-in: e796c0ef user: drh tags: trunk
14:19
Fix an assert() in btree.c that is only true for non-corrupt databases. check-in: 29f7227f user: drh tags: trunk
12:59
Clear the BTCF_ValidNKey flag when putting a cursor into REQUIRESEEK state. Fix for [1b266395]. check-in: a6d5e4e8 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

  7620   7620       ** for which the pointer is stored within the content being copied.
  7621   7621       **
  7622   7622       ** It is critical that the child page be defragmented before being
  7623   7623       ** copied into the parent, because if the parent is page 1 then it will
  7624   7624       ** by smaller than the child due to the database header, and so all the
  7625   7625       ** free space needs to be up front.
  7626   7626       */
  7627         -    assert( nNew==1 );
         7627  +    assert( nNew==1 || CORRUPT_DB );
  7628   7628       rc = defragmentPage(apNew[0]);
  7629   7629       testcase( rc!=SQLITE_OK );
  7630   7630       assert( apNew[0]->nFree == 
  7631   7631           (get2byte(&apNew[0]->aData[5])-apNew[0]->cellOffset-apNew[0]->nCell*2)
  7632   7632         || rc!=SQLITE_OK
  7633   7633       );
  7634   7634       copyNodeContent(apNew[0], pParent, &rc);