mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 01:51:59 +00:00
Fix moving sum segfault
This commit is contained in:
parent
61a8d9b137
commit
2ef491bc53
@ -154,12 +154,13 @@ public:
|
||||
if (unlikely(size > AGGREGATE_FUNCTION_MOVING_MAX_ARRAY_SIZE))
|
||||
throw Exception("Too large array size", ErrorCodes::TOO_LARGE_ARRAY_SIZE);
|
||||
|
||||
auto & value = this->data(place).value;
|
||||
|
||||
value.resize(size, arena);
|
||||
buf.read(reinterpret_cast<char *>(value.data()), size * sizeof(value[0]));
|
||||
|
||||
this->data(place).sum = value.back();
|
||||
if (size > 0)
|
||||
{
|
||||
auto & value = this->data(place).value;
|
||||
value.resize(size, arena);
|
||||
buf.read(reinterpret_cast<char *>(value.data()), size * sizeof(value[0]));
|
||||
this->data(place).sum = value.back();
|
||||
}
|
||||
}
|
||||
|
||||
void insertResultInto(AggregateDataPtr place, IColumn & to, Arena *) const override
|
||||
|
@ -0,0 +1 @@
|
||||
[]
|
@ -0,0 +1 @@
|
||||
SELECT groupArrayMovingSum(10)(0) FROM remote('127.0.0.{1,2}', numbers(0))
|
Loading…
Reference in New Issue
Block a user