1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Fix a problem with flattening and window functions causing an "IS <column>" to be transformed to "IS TRUE" or "IS FALSE" when <column> is a view or sub-select expression that is the literal value "TRUE" or "FALSE".

FossilOrigin-Name: 2a952c7738d94e70024e06600fee8c3a49f317f2d02774468019bd7cf9488c8b
This commit is contained in:
dan
2022-06-02 16:26:21 +00:00
parent bf154369e7
commit 410fac35d7
4 changed files with 108 additions and 8 deletions

View File

@@ -3810,6 +3810,11 @@ static Expr *substExpr(
}
sqlite3ExprDelete(db, pExpr);
pExpr = pNew;
if( pExpr->op==TK_TRUEFALSE ){
pExpr->u.iValue = sqlite3ExprTruthValue(pExpr);
pExpr->op = TK_INTEGER;
ExprSetProperty(pExpr, EP_IntValue);
}
/* Ensure that the expression now has an implicit collation sequence,
** just as it did when it was a column of a view or sub-query. */