aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/expr.c b/src/expr.c
index 7e1483a90..c7abd1616 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -6030,6 +6030,13 @@ static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
case TK_OR:
case TK_AND:
+ /* Both sides of an AND or OR must separately imply non-NULL row.
+ ** Consider these cases:
+ ** 1. NOT (x AND y)
+ ** 2. x OR y
+ ** If only one of x or y is non-null-row, then the overall expression
+ ** can be true if the other arm is false (case 1) or true (case 2).
+ */
testcase( pExpr->op==TK_OR );
testcase( pExpr->op==TK_AND );
if( pWalker->eCode==0 ){