Merge pull request #25314 from ClickHouse/fix-ubsan-quantile-timing

Fix UBSan report in quantileTiming
This commit is contained in:
alexey-milovidov 2021-06-17 01:24:24 +03:00 committed by GitHub
commit 5de9f6cdca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View File

@ -113,8 +113,8 @@ public:
if constexpr (std::is_same_v<Data, QuantileTiming<Value>>)
{
/// QuantileTiming only supports integers.
if (isNaN(value) || value > std::numeric_limits<Value>::max() || value < std::numeric_limits<Value>::min())
/// QuantileTiming only supports unsigned integers. Too large values are also meaningless.
if (isNaN(value) || value > std::numeric_limits<Int64>::max() || value < 0)
return;
}

View File

@ -0,0 +1 @@
0

View File

@ -0,0 +1 @@
SELECT quantileTiming(-0.)(number / 1.1754943508222875e-38) FROM numbers(257);