diff options
author | drh <> | 2023-05-31 18:52:46 +0000 |
---|---|---|
committer | drh <> | 2023-05-31 18:52:46 +0000 |
commit | d8cf688469e3343fc050ab500b1566d3b9e53801 (patch) | |
tree | af65b245ff95c48f4e1d9686a95a359c047c4e5f /src/expr.c | |
parent | 29e70da4a4e86a8b0bf08632750f879f662e936c (diff) | |
download | sqlite-d8cf688469e3343fc050ab500b1566d3b9e53801.tar.gz sqlite-d8cf688469e3343fc050ab500b1566d3b9e53801.zip |
Add a comment to explain why both sides of an AND must be non-null-row in order
for the overall expression to be non-null-row. No code changes.
FossilOrigin-Name: 8396032ce14a75f408f0a75bcb36a6504d5188f20886e275746a2c336a74296f
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 7 |
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 ){ |