1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-16 23:02:26 +03:00

Fix an off-by-one error in the Bloom filter pulldown logic, found by OSSFuzz.

Also fix over-length source code lines in the immediate vicinity.

FossilOrigin-Name: 027626521c02be06ef61e8229bde49d20cb3f1cb600c4cb127c5f139b9de8858
This commit is contained in:
drh
2021-12-13 18:43:46 +00:00
parent 089a9ff48a
commit c5860af006
3 changed files with 14 additions and 12 deletions

View File

@@ -1069,16 +1069,18 @@ static SQLITE_NOINLINE void sqlite3ConstructBloomFilter(
sqlite3VdbeJumpHere(v, addrTop);
pLoop->wsFlags &= ~WHERE_BLOOMFILTER;
if( OptimizationDisabled(pParse->db, SQLITE_BloomPulldown) ) break;
while( iLevel < pWInfo->nLevel ){
iLevel++;
while( ++iLevel < pWInfo->nLevel ){
pLevel = &pWInfo->a[iLevel];
pLoop = pLevel->pWLoop;
if( pLoop==0 ) continue;
if( pLoop->prereq & notReady ) continue;
if( (pLoop->wsFlags & (WHERE_BLOOMFILTER|WHERE_COLUMN_IN))==WHERE_BLOOMFILTER ){
if( (pLoop->wsFlags & (WHERE_BLOOMFILTER|WHERE_COLUMN_IN))
==WHERE_BLOOMFILTER
){
/* This is a candidate for bloom-filter pull-down (early evaluation).
** The test that WHERE_COLUMN_IN is omitted is important, as we are not able
** to do early evaluation of bloom filters that make use of the IN operator */
** The test that WHERE_COLUMN_IN is omitted is important, as we are
** not able to do early evaluation of bloom filters that make use of
** the IN operator */
break;
}
}