mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +00:00
SQLUserDefinedFunctions invalid lambda crash fix
This commit is contained in:
parent
cb7bac2db5
commit
3b24c39294
@ -66,7 +66,12 @@ void InterpreterCreateFunctionQuery::validateFunction(ASTPtr function, const Str
|
||||
|
||||
for (const auto & argument : tuple_function_arguments.arguments->children)
|
||||
{
|
||||
const auto & argument_name = argument->as<ASTIdentifier>()->name();
|
||||
const auto * argument_identifier = argument->as<ASTIdentifier>();
|
||||
|
||||
if (!argument_identifier)
|
||||
throw Exception(ErrorCodes::UNSUPPORTED_METHOD, "Lambda argument must be identifier");
|
||||
|
||||
const auto & argument_name = argument_identifier->name();
|
||||
auto [_, inserted] = arguments.insert(argument_name);
|
||||
if (!inserted)
|
||||
throw Exception(ErrorCodes::UNSUPPORTED_METHOD, "Identifier {} already used as function parameter", argument_name);
|
||||
|
@ -0,0 +1 @@
|
||||
CREATE FUNCTION 02181_invalid_lambda AS lambda(((x * 2) AS x_doubled) + x_doubled); --{serverError 1}
|
Loading…
Reference in New Issue
Block a user