aboutsummaryrefslogtreecommitdiff
path: root/src/expr.c
diff options
context:
space:
mode:
authordrh <>2025-07-01 12:43:13 +0000
committerdrh <>2025-07-01 12:43:13 +0000
commitd82c6a2cf7394354ed1a17ad26d42b02766bb0d2 (patch)
tree8e9ac89dfa2556a13d95f29190491c00e78f88cb /src/expr.c
parent99f1aa03fb6cb417bd342b79ee09af61245c212f (diff)
downloadsqlite-d82c6a2cf7394354ed1a17ad26d42b02766bb0d2.tar.gz
sqlite-d82c6a2cf7394354ed1a17ad26d42b02766bb0d2.zip
When attempting to optimize "expr AND false" to "false" and
"expr IN ()" to "false", take care not to delete aggregate functions in the "expr" as doing so can change the meaning of the query. See [forum:/forumpost/f4878de3e7dd4764|forum thread f4878de3e7]. FossilOrigin-Name: 77397bd67d918db57d5ac545d6d963194806fdabcdaa8f822b6b09e4cfe8b715
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/expr.c b/src/expr.c
index 6cb9c2aa1..9ed0a121e 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -1144,7 +1144,7 @@ Expr *sqlite3ExprAnd(Parse *pParse, Expr *pLeft, Expr *pRight){
return pLeft;
}else{
u32 f = pLeft->flags | pRight->flags;
- if( (f&(EP_OuterON|EP_InnerON|EP_IsFalse))==EP_IsFalse
+ if( (f&(EP_OuterON|EP_InnerON|EP_IsFalse|EP_HasFunc))==EP_IsFalse
&& !IN_RENAME_OBJECT
){
sqlite3ExprDeferredDelete(pParse, pLeft);