Fix other problems similar to ticket [c0390363].
FossilOrigin-Name: 96ff2ba9c4bb71d5f7c6f359986a76a5364b7ac3e1a612441543a9eabecf31df
diff --git a/src/expr.c b/src/expr.c
index 80bc002..fbed5f9 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -5014,14 +5014,16 @@
case TK_GE:
case TK_PLUS:
case TK_MINUS:
+ case TK_BITOR:
+ case TK_LSHIFT:
+ case TK_RSHIFT:
+ case TK_CONCAT:
+ seenNot = 1;
+ /* Fall thru */
case TK_STAR:
case TK_REM:
case TK_BITAND:
- case TK_BITOR:
- case TK_SLASH:
- case TK_LSHIFT:
- case TK_RSHIFT:
- case TK_CONCAT: {
+ case TK_SLASH: {
if( exprImpliesNotNull(pParse, p->pRight, pNN, iTab, seenNot) ) return 1;
/* Fall thru into the next case */
}
@@ -5102,8 +5104,6 @@
if( ExprHasProperty(pExpr, EP_FromJoin) ) return WRC_Prune;
switch( pExpr->op ){
case TK_ISNOT:
- case TK_NOT:
- case TK_BITNOT:
case TK_ISNULL:
case TK_NOTNULL:
case TK_IS:
@@ -5128,6 +5128,18 @@
}
return WRC_Prune;
+ case TK_AND:
+ if( sqlite3ExprImpliesNonNullRow(pExpr->pLeft, pWalker->u.iCur)
+ && sqlite3ExprImpliesNonNullRow(pExpr->pRight, pWalker->u.iCur)
+ ){
+ pWalker->eCode = 1;
+ }
+ return WRC_Prune;
+
+ case TK_BETWEEN:
+ sqlite3WalkExpr(pWalker, pExpr->pLeft);
+ return WRC_Prune;
+
/* Virtual tables are allowed to use constraints like x=NULL. So
** a term of the form x=y does not prove that y is not null if x
** is the column of a virtual table */
@@ -5148,6 +5160,7 @@
){
return WRC_Prune;
}
+
default:
return WRC_Continue;
}