mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-12 13:01:09 +03:00
Use NOT NULL partial indexes when the query is constrained by a single
LIKE or GLOB. FossilOrigin-Name: 9b3a3b41b59a7ce7d3dd82c7402d6fdc6a5ca43c
This commit is contained in:
@@ -4600,11 +4600,10 @@ int sqlite3ExprImpliesExpr(Expr *pE1, Expr *pE2, int iTab){
|
||||
){
|
||||
return 1;
|
||||
}
|
||||
if( pE2->op==TK_NOTNULL
|
||||
&& sqlite3ExprCompare(pE1->pLeft, pE2->pLeft, iTab)==0
|
||||
&& (pE1->op!=TK_ISNULL && pE1->op!=TK_IS)
|
||||
){
|
||||
return 1;
|
||||
if( pE2->op==TK_NOTNULL && pE1->op!=TK_ISNULL && pE1->op!=TK_IS ){
|
||||
Expr *pX = sqlite3ExprSkipCollate(pE1->pLeft);
|
||||
testcase( pX!=pE1->pLeft );
|
||||
if( sqlite3ExprCompare(pX, pE2->pLeft, iTab)==0 ) return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user