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
Copy file name to clipboardExpand all lines: tests/sqllogictests/suites/query/aggregate.test
+18Lines changed: 18 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,24 @@ SELECT SUM(agg0) FROM (
69
69
----
70
70
4.0
71
71
72
+
query TT
73
+
select typeof(sum(number::Decimal(18, 1))), typeof(sum(number::Decimal(19, 1))) from numbers(1000);
74
+
----
75
+
DECIMAL(18, 1) NULL DECIMAL(38, 1) NULL
76
+
77
+
query TT
78
+
settings(enable_decimal_sum_widening=1) select typeof(sum(number::Decimal(18, 1))), typeof(sum(number::Decimal(19, 1))) from numbers(1000);
79
+
----
80
+
DECIMAL(18, 1) NULL DECIMAL(76, 1) NULL
81
+
82
+
statement error Decimal overflow
83
+
select sum(a) from (select '99999999999999999999999999999999999999'::Decimal(38, 0) as a union all select 1::Decimal(38, 0) as a)
84
+
85
+
query RT
86
+
settings(enable_decimal_sum_widening=1) select sum(a), typeof(sum(a)) from (select '99999999999999999999999999999999999999'::Decimal(38, 0) as a union all select 1::Decimal(38, 0) as a);
0 commit comments