mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-10-04 07:30:52 +00:00
allow nested if (useless but also harmless)
This commit is contained in:
parent
effb404c7e
commit
12a36c0e9f
@ -35,13 +35,6 @@ public:
|
|||||||
if (num_arguments == 0)
|
if (num_arguments == 0)
|
||||||
throw Exception("Aggregate function " + getName() + " require at least one argument", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
|
throw Exception("Aggregate function " + getName() + " require at least one argument", ErrorCodes::NUMBER_OF_ARGUMENTS_DOESNT_MATCH);
|
||||||
|
|
||||||
IAggregateFunction * sub = this;
|
|
||||||
while ((sub = sub->getNestedFunction().get()))
|
|
||||||
{
|
|
||||||
if (dynamic_cast<AggregateFunctionIf *>(sub))
|
|
||||||
throw Exception("Cannot nest -If combinator", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isUInt8(types.back()))
|
if (!isUInt8(types.back()))
|
||||||
throw Exception("Last argument for aggregate function " + getName() + " must be UInt8", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
|
throw Exception("Last argument for aggregate function " + getName() + " must be UInt8", ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user