mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
Fix UBSan report in avgWeighted
This commit is contained in:
parent
7d2108d4e9
commit
02d28c1f9b
@ -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]);
|
||||
|
||||
|
@ -0,0 +1 @@
|
||||
-0
|
1
tests/queries/0_stateless/01668_avg_weighted_ubsan.sql
Normal file
1
tests/queries/0_stateless/01668_avg_weighted_ubsan.sql
Normal 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);
|
Loading…
Reference in New Issue
Block a user