You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Wrapped unary negation under IS NULL can escape analyzer type validation #20988
An invalid unary negation expression can escape analyzer/type coercion validation when wrapped by IS NULL.
For example, SELECT * FROM (SELECT 1) WHERE ((-'a') IS NULL) is accepted during planning and optimization, even though -'a' is not a valid negation expression.
To Reproduce
#[tokio::test]asyncfnwrapped_negation_is_accepted(){let ctx = SessionContext::new();let plan = ctx
.sql("SELECT * FROM (SELECT 1) WHERE ((-'a') IS NULL)").await.unwrap().into_optimized_plan();assert!(plan.is_ok());}
I also verified that the same query executes successfully and returns Ok([]) before the fix.
Expected behavior
Invalid wrapped negation expressions such as (-'a') IS NULL should be rejected during analyzer/type coercion, rather than being accepted.
Additional context
This appears to be a gap in expression validation for Expr::Negative.
Activity
myandpr commentedon Mar 17, 2026
take
fix: validate wrapped negation during type coercion (#20965)
fix: validate wrapped negation during type coercion (apache#20965)