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
Unexpected result when using BETWEEN and CASE WHEN #15602
Consider the following test case. The second query returned false, showing that the expression (((CASE t0.c0 WHEN t0.c0 THEN t0.c0 END ) BETWEEN 1 AND t0.c0)AND(t0.c0 <= 0)) should be evaluated to false; however, the third query return -1, which is unexpected.
To Reproduce
CREATETABLEt0(c0 INT);
INSERT INTO t0( c0) VALUES ( -1);
SELECT*FROM t0; -- -1SELECT (((CASE t0.c0 WHEN t0.c0 THEN t0.c0 END ) BETWEEN 1ANDt0.c0)AND(t0.c0<=0)) FROM t0; -- falseSELECT*FROM t0 WHERE (((CASE t0.c0 WHEN t0.c0 THEN t0.c0 END ) BETWEEN 1ANDt0.c0)AND(t0.c0<=0)) ;
-- Expected: empty table-- Actual: -1
changed the title [-]Unexpected result when using `BETWEEN ` and `CASE WHEN`[/-][+]Unexpected result when using `BETWEEN` and `CASE WHEN`[/+]on Jan 8, 2025
Activity
szarnyasg commentedon Jan 8, 2025
Thanks! Indeed, Postgres returns an empty table:
[-]Unexpected result when using `BETWEEN ` and `CASE WHEN`[/-][+]Unexpected result when using `BETWEEN` and `CASE WHEN`[/+]Fix duckdb#15602: also add unsatisfiable filters to the set, and prop…
Fix #15602: also add unsatisfiable filters to the set, and propagate …