mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Merge pull request #40025 from CurtizJ/fix-aggregate-function-type
Fix segfault in `DataTypeAggregateFunction`
This commit is contained in:
commit
2716f7a148
@ -135,14 +135,14 @@ bool DataTypeAggregateFunction::equals(const IDataType & rhs) const
|
||||
if (lhs_state->function->getName() != rhs_state.function->getName())
|
||||
return false;
|
||||
|
||||
if (lhs_state->parameters.size() != lhs_state->parameters.size())
|
||||
if (lhs_state->parameters.size() != rhs_state.parameters.size())
|
||||
return false;
|
||||
|
||||
for (size_t i = 0; i < lhs_state->parameters.size(); ++i)
|
||||
if (lhs_state->parameters[i] != rhs_state.parameters[i])
|
||||
return false;
|
||||
|
||||
if (lhs_state->argument_types.size() != lhs_state->argument_types.size())
|
||||
if (lhs_state->argument_types.size() != rhs_state.argument_types.size())
|
||||
return false;
|
||||
|
||||
for (size_t i = 0; i < lhs_state->argument_types.size(); ++i)
|
||||
|
@ -10,11 +10,13 @@ SELECT sumMerge(x + y), sumMerge(x), sumMerge(y) FROM (SELECT sumState(a) as x,
|
||||
SELECT sumMerge(x) FROM (SELECT sumState(a) + countState(b) as x FROM add_aggregate); -- { serverError 421 }
|
||||
SELECT sumMerge(x) FROM (SELECT sumState(a) + sumState(toInt32(b)) as x FROM add_aggregate); -- { serverError 421 }
|
||||
|
||||
SELECT minMerge(x) FROM (SELECT minState(a) + minState(b) as x FROM add_aggregate);
|
||||
SELECT minMerge(x) FROM (SELECT minState(a) + minState(b) as x FROM add_aggregate);
|
||||
|
||||
SELECT uniqMerge(x + y) FROM (SELECT uniqState(a) as x, uniqState(b) as y FROM add_aggregate);
|
||||
|
||||
SELECT arraySort(groupArrayMerge(x + y)) FROM (SELECT groupArrayState(a) AS x, groupArrayState(b) as y FROM add_aggregate);
|
||||
SELECT arraySort(groupUniqArrayMerge(x + y)) FROM (SELECT groupUniqArrayState(a) AS x, groupUniqArrayState(b) as y FROM add_aggregate);
|
||||
|
||||
SELECT uniqMerge(x + y) FROM (SELECT uniqState(65536, a) AS x, uniqState(b) AS y FROM add_aggregate); -- { serverError 421 }
|
||||
|
||||
DROP TABLE IF EXISTS add_aggregate;
|
||||
|
Loading…
Reference in New Issue
Block a user