SQLite

Check-in [a6509ca3dc]
Login

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

Overview
Comment:Fix an assert() that might not be true if the %_segdir table of FTS3 contains corrupt entries.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: a6509ca3dc2602c7d0376230ee63c1bb4c4066f007e77e9ac20d8eee966e5e13
User & Date: drh 2019-02-18 12:16:03.611
Context
2019-02-19
13:08
Always use the symbolic name SQLITE_IDXTYPE_PRIMARYKEY rather than a hard-coded magic number 2. (check-in: 55d43adc89 user: drh tags: trunk)
2019-02-18
12:16
Fix an assert() that might not be true if the %_segdir table of FTS3 contains corrupt entries. (check-in: a6509ca3dc user: drh tags: trunk)
2019-02-16
22:45
Fix an assert() that might be false for a corrupt database. (check-in: 0cfb888723 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to ext/fts3/fts3_write.c.
1344
1345
1346
1347
1348
1349
1350

1351

1352
1353
1354
1355
1356
1357
1358
      return SQLITE_OK;
    }

    fts3SegReaderSetEof(pReader);

    /* If iCurrentBlock>=iLeafEndBlock, this is an EOF condition. All leaf 
    ** blocks have already been traversed.  */

    assert( pReader->iCurrentBlock<=pReader->iLeafEndBlock );

    if( pReader->iCurrentBlock>=pReader->iLeafEndBlock ){
      return SQLITE_OK;
    }

    rc = sqlite3Fts3ReadBlock(
        p, ++pReader->iCurrentBlock, &pReader->aNode, &pReader->nNode, 
        (bIncr ? &pReader->nPopulate : 0)







>
|
>







1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
      return SQLITE_OK;
    }

    fts3SegReaderSetEof(pReader);

    /* If iCurrentBlock>=iLeafEndBlock, this is an EOF condition. All leaf 
    ** blocks have already been traversed.  */
#ifdef CORRUPT_DB
    assert( pReader->iCurrentBlock<=pReader->iLeafEndBlock || CORRUPT_DB );
#endif
    if( pReader->iCurrentBlock>=pReader->iLeafEndBlock ){
      return SQLITE_OK;
    }

    rc = sqlite3Fts3ReadBlock(
        p, ++pReader->iCurrentBlock, &pReader->aNode, &pReader->nNode, 
        (bIncr ? &pReader->nPopulate : 0)
Changes to test/fuzzdata8.db.

cannot compute difference between binary files