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
SELECT ALL ++MIN ( - CAST ( +6ASINTEGER ) ) * CASE WHEN NULL BETWEEN -88AND ( --91 ) *-AVG ( 95 ) THEN COUNT ( -34 ) END
Both PG and sqlite have a result of 'null'. DF result is '-6'
The difference looks to be the handling of a case clause that doesn't match and doesn't have an else block. Most db's including PG have the result of a case block with no matches and no else to be 'null'. It seems DF is '1'
>select CASE WHEN NULL BETWEEN -88AND ( --91 ) *-AVG ( 95 ) THEN COUNT ( -34 ) END;
+------------------------------------------------------------------------------------------------------+
| CASE WHEN NULL BETWEEN Int64(-88) AND (- Int64(-91)) * (-avg(Int64(95))) THEN count(Int64(-34)) END |
+------------------------------------------------------------------------------------------------------+
| 1 |
+------------------------------------------------------------------------------------------------------+
The following is duckdb's behavior with the same sql:
D select CASE WHEN NULL BETWEEN -88AND ( --91 ) *-AVG ( 95 ) THEN COUNT ( -34 ) END;
┌───────────────────────────────────────────────────────────────────────────────────────┐
│ CASE WHEN ((NULL BETWEEN -88AND (91*-(avg(95))))) THEN (count(-34)) ELSE NULL END │
│ int64 │
├───────────────────────────────────────────────────────────────────────────────────────┤
│ │
└───────────────────────────────────────────────────────────────────────────────────────┘
D select typeof(CASE WHEN NULL BETWEEN -88AND ( --91 ) *-AVG ( 95 ) THEN COUNT ( -34 ) END);
┌───────────────────────────────────────────────────────────────────────────────────────────────┐
│ typeof(CASE WHEN ((NULL BETWEEN -88AND (91*-(avg(95))))) THEN (count(-34)) ELSE NULL END) │
│ varchar │
├───────────────────────────────────────────────────────────────────────────────────────────────┤
│ BIGINT │
└───────────────────────────────────────────────────────────────────────────────────────────────┘
To Reproduce
sql above.
Expected behavior
I would expect the same result as PG and other db's.
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
sqlite random/expr/slt_good_10.slt:
Both PG and sqlite have a result of 'null'. DF result is '-6'
The difference looks to be the handling of a case clause that doesn't match and doesn't have an else block. Most db's including PG have the result of a case block with no matches and no else to be 'null'. It seems DF is '1'
The following is duckdb's behavior with the same sql:
To Reproduce
sql above.
Expected behavior
I would expect the same result as PG and other db's.
Additional context
No response
The text was updated successfully, but these errors were encountered: