aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/expr.c b/src/expr.c
index 707a9ca6b..92e96b0f1 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -6026,6 +6026,7 @@ static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
case TK_VECTOR:
case TK_FUNCTION:
case TK_TRUTH:
+ case TK_CASE:
testcase( pExpr->op==TK_ISNOT );
testcase( pExpr->op==TK_ISNULL );
testcase( pExpr->op==TK_NOTNULL );
@@ -6033,6 +6034,7 @@ static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
testcase( pExpr->op==TK_VECTOR );
testcase( pExpr->op==TK_FUNCTION );
testcase( pExpr->op==TK_TRUTH );
+ testcase( pExpr->op==TK_CASE );
return WRC_Prune;
case TK_COLUMN:
@@ -6055,16 +6057,6 @@ static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
testcase( pExpr->op==TK_AND );
bothImplyNotNullRow(pWalker, pExpr->pLeft, pExpr->pRight);
return WRC_Prune;
-
- case TK_CASE:
- /* In "CASE x WHEN y THEN ..." the overall expression is non-null-row
- ** if either x or y is non-null-row. If the neither x nor y is
- ** non-null-row, assume the whole expression is not, to be safe. */
- assert( ExprUseXList(pExpr) );
- assert( pExpr->x.pList->nExpr>0 );
- sqlite3WalkExpr(pWalker, pExpr->pLeft);
- sqlite3WalkExpr(pWalker, pExpr->x.pList->a[0].pExpr);
- return WRC_Prune;
case TK_IN:
/* Beware of "x NOT IN ()" and "x NOT IN (SELECT 1 WHERE false)",