1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-10 01:02:56 +03:00

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
This commit is contained in:
drh
2023-05-31 18:52:46 +00:00
parent 29e70da4a4
commit d8cf688469
3 changed files with 14 additions and 7 deletions

View File

@@ -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 ){