Skip to content

Commit

Permalink
Correctly handle expressions like "x IS (not) true/false" within the …
Browse files Browse the repository at this point in the history
…rhs of IN() expressions. Fix for [f3ff1472].
  • Loading branch information
danielk-1977 committed Aug 24, 2020
1 parent b77cb99 commit 935c7f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/resolve.c
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
assert( !ExprHasProperty(pExpr, EP_Reduced) );
/* Handle special cases of "x IS TRUE", "x IS FALSE", "x IS NOT TRUE",
** and "x IS NOT FALSE". */
if( pRight && pRight->op==TK_ID ){
if( pRight && (pRight->op==TK_ID || pRight->op==TK_TRUEFALSE) ){
int rc = resolveExprStep(pWalker, pRight);
if( rc==WRC_Abort ) return WRC_Abort;
if( pRight->op==TK_TRUEFALSE ){
Expand Down
6 changes: 6 additions & 0 deletions test/in.test
Original file line number Diff line number Diff line change
Expand Up @@ -791,4 +791,10 @@ do_execsql_test in-19.40 {
PRAGMA integrity_check;
} {ok}

# Ticket f3ff1472887
#
do_execsql_test in-20.1 {
SELECT (1 IN (2 IS TRUE));
} {1}

finish_test

0 comments on commit 935c7f7

Please sign in to comment.