1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Better solution to the LIKE problem from the previous check-in that works

even if the SQLITE_LIKE_DOESNT_MATCH_BLOBS compile-time option is used.

FossilOrigin-Name: b850dd159918af568c55c00ff146ba9c9c04d33ff384fe1eb0ad74164bc401bb
This commit is contained in:
drh
2018-04-02 00:16:36 +00:00
parent 1f0ecc79b0
commit 4de3353d4a
3 changed files with 11 additions and 10 deletions

View File

@@ -2127,7 +2127,7 @@ Bitmask sqlite3WhereCodeOneLoopStart(
continue;
}
if( (pTerm->wtFlags & TERM_LIKECOND)!=0 && pLevel->iLikeRepCntr ){
if( (pTerm->wtFlags & TERM_LIKECOND)!=0 ){
/* If the TERM_LIKECOND flag is set, that means that the range search
** is sufficient to guarantee that the LIKE operator is true, so we
** can skip the call to the like(A,B) function. But this only works
@@ -2137,8 +2137,9 @@ Bitmask sqlite3WhereCodeOneLoopStart(
continue;
#else
u32 x = pLevel->iLikeRepCntr;
assert( x>0 );
skipLikeAddr = sqlite3VdbeAddOp1(v, (x&1)?OP_IfNot:OP_If, (int)(x>>1));
if( x>0 ){
skipLikeAddr = sqlite3VdbeAddOp1(v, (x&1)?OP_IfNot:OP_If,(int)(x>>1));
}
VdbeCoverage(v);
#endif
}