Fix UBSan report in avgWeighted

This commit is contained in:
Alexey Milovidov 2021-01-23 03:17:58 +03:00
parent 7d2108d4e9
commit 02d28c1f9b
3 changed files with 3 additions and 1 deletions

View File

@ -28,7 +28,7 @@ public:
using ValueT = MaxFieldType<Value, Weight>;
void add(AggregateDataPtr place, const IColumn ** columns, size_t row_num, Arena *) const override
void NO_SANITIZE_UNDEFINED add(AggregateDataPtr place, const IColumn ** columns, size_t row_num, Arena *) const override
{
const auto& weights = static_cast<const DecimalOrVectorCol<Weight> &>(*columns[1]);

View File

@ -0,0 +1 @@
-0

View File

@ -0,0 +1 @@
SELECT round(avgWeighted(x, y)) FROM (SELECT 1023 AS x, 1000000000 AS y UNION ALL SELECT 10 AS x, -9223372036854775808 AS y);