1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-18 10:21:03 +03:00

Back out the incorrect optimization of check-in [e51ecadcbdef5ce6] as

ticket [5c4e7aa793943803] reports a case where the optimization does not
work.

FossilOrigin-Name: 7395e96b8cc370c8ac2657fb805915b0992a15d80f8bf256d277b423fec64675
This commit is contained in:
drh
2020-09-30 17:32:22 +00:00
parent af3711536b
commit 395a60dad4
4 changed files with 18 additions and 12 deletions

View File

@@ -1763,8 +1763,7 @@ Bitmask sqlite3WhereCodeOneLoopStart(
Expr *pRight = pRangeStart->pExpr->pRight;
codeExprOrVector(pParse, pRight, regBase+nEq, nBtm);
whereLikeOptimizationStringFixup(v, pLevel, pRangeStart);
if( !bRev
&& (pRangeStart->wtFlags & TERM_VNULL)==0
if( (pRangeStart->wtFlags & TERM_VNULL)==0
&& sqlite3ExprCanBeNull(pRight)
){
sqlite3VdbeAddOp2(v, OP_IsNull, regBase+nEq, addrNxt);
@@ -1839,8 +1838,7 @@ Bitmask sqlite3WhereCodeOneLoopStart(
Expr *pRight = pRangeEnd->pExpr->pRight;
codeExprOrVector(pParse, pRight, regBase+nEq, nTop);
whereLikeOptimizationStringFixup(v, pLevel, pRangeEnd);
if( bRev
&& (pRangeEnd->wtFlags & TERM_VNULL)==0
if( (pRangeEnd->wtFlags & TERM_VNULL)==0
&& sqlite3ExprCanBeNull(pRight)
){
sqlite3VdbeAddOp2(v, OP_IsNull, regBase+nEq, addrNxt);