1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Add VdbeCoverage() macros. Adjust the Bloom-filter hash function so that it

correctly deals with zero-blobs.

FossilOrigin-Name: 629ee2e3e3125bfd2af435c6713d49e46691213ad15db0a5e93a63a77f1130c2
This commit is contained in:
drh
2021-12-04 18:45:08 +00:00
parent 770dade262
commit 067c60cfc9
5 changed files with 21 additions and 12 deletions

View File

@@ -695,6 +695,7 @@ static unsigned int filterHash(const Mem *aMem, const Op *pOp){
h += (u32)(sqlite3VdbeIntValue(p)&0xffffffff);
}else if( p->flags & (MEM_Str|MEM_Blob) ){
h += p->n;
if( p->flags & MEM_Zero ) h += p->u.nZero;
}
}
return h % (SQLITE_BLOOM_SZ*8);
@@ -8229,7 +8230,12 @@ case OP_Filter: { /* jump */
}
#endif
assert( h>=0 && h<SQLITE_BLOOM_SZ*8 );
if( (pIn1->z[h/8] & (1<<(h&7)))==0 ) goto jump_to_p2;
if( (pIn1->z[h/8] & (1<<(h&7)))==0 ){
VdbeBranchTaken(1, 2);
goto jump_to_p2;
}else{
VdbeBranchTaken(0, 2);
}
break;
}