Fix UBSan report in quantileTiming

This commit is contained in:
Alexey Milovidov 2021-06-16 10:38:36 +03:00
parent 7180cf2367
commit d1bba10be0
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);