tests: added tests for sumWithOverflow(x) preserving input type

This commit is contained in:
Marek Vavruša 2017-10-18 15:12:31 -07:00 committed by alexey-milovidov
parent c0458999f9
commit ee22253857
2 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,6 @@
UInt64
UInt16
Float64
Float32
4950
4950

View File

@ -0,0 +1,7 @@
SELECT toTypeName(sum(n)) FROM (SELECT toUInt16(number) AS n FROM system.numbers LIMIT 100);
SELECT toTypeName(sumWithOverflow(n)) FROM (SELECT toUInt16(number) AS n FROM system.numbers LIMIT 100);
SELECT toTypeName(sum(n)) FROM (SELECT toFloat32(number) AS n FROM system.numbers LIMIT 100);
SELECT toTypeName(sumWithOverflow(n)) FROM (SELECT toFloat32(number) AS n FROM system.numbers LIMIT 100);
SELECT sum(n) FROM (SELECT toUInt16(number) AS n FROM system.numbers LIMIT 100);
SELECT sumWithOverflow(n) FROM (SELECT toUInt16(number) AS n FROM system.numbers LIMIT 100);