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

Do not confuse the ">" operator with IS NOT NULL when checking to see if

a partial index is usable.
[forum:/forumpost/d813704d7c|Forum post d813704d7c].

FossilOrigin-Name: 8cc23931d61b7d78521acce93fc2603649c5813c7a0869cb2c1bde2c8c4e51b4
This commit is contained in:
drh
2021-05-29 23:07:59 +00:00
parent d36bcec9ad
commit d65b7e36ec
4 changed files with 20 additions and 9 deletions

View File

@@ -2914,7 +2914,8 @@ static int whereUsablePartialIndex(
pExpr = pTerm->pExpr;
if( (!ExprHasProperty(pExpr, EP_FromJoin) || pExpr->iRightJoinTable==iTab)
&& (isLeft==0 || ExprHasProperty(pExpr, EP_FromJoin))
&& sqlite3ExprImpliesExpr(pParse, pExpr, pWhere, iTab)
&& sqlite3ExprImpliesExpr(pParse, pExpr, pWhere, iTab)
&& (pTerm->wtFlags & TERM_VNULL)==0
){
return 1;
}