ClickHouse/tests/queries/0_stateless/01660_sum_ubsan.reference

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
435 B
Plaintext
Raw Normal View History

2021-12-10 18:51:43 +00:00
-- { echo }
-- Aggregate function 'sum' allows overflow with two's complement arithmetics.
-- This contradicts the standard SQL semantic and we are totally fine with it.
SELECT sum(-8000000000000000000) FROM numbers(11);
4233720368547758080
2021-12-10 18:51:43 +00:00
SELECT sum(-8000000000000000000) FROM remote('127.0.0.{1,2,3,4,5,6,7,8,9,10,11}', system.one);
2021-01-21 22:49:37 +00:00
4233720368547758080
2021-12-10 18:51:43 +00:00
SELECT sumKahan(-8000000000000000000) FROM numbers(11);
2021-01-21 22:49:37 +00:00
-88000000000000000000