mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +00:00
Merge pull request #33868 from kitaisreal/sql-user-defined-functions-invalid-lambda-crash-fix
SQLUserDefinedFunctions invalid lambda crash fix
This commit is contained in:
commit
330987a64b
@ -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