mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 17:41:59 +00:00
Merge pull request #63293 from ClickHouse/backport/24.3/63131
Backport #63131 to 24.3: Fix crash with untuple and unresolved lambda
This commit is contained in:
commit
ca2ab86412
@ -5729,6 +5729,10 @@ ProjectionNames QueryAnalyzer::resolveFunction(QueryTreeNodePtr & node, Identifi
|
||||
checkFunctionNodeHasEmptyNullsAction(function_node);
|
||||
|
||||
const auto & untuple_argument = function_arguments[0];
|
||||
/// Handle this special case first as `getResultType()` might return nullptr
|
||||
if (untuple_argument->as<LambdaNode>())
|
||||
throw Exception(ErrorCodes::ILLEGAL_TYPE_OF_ARGUMENT, "Function untuple can't have lambda-expressions as arguments");
|
||||
|
||||
auto result_type = untuple_argument->getResultType();
|
||||
const auto * tuple_data_type = typeid_cast<const DataTypeTuple *>(result_type.get());
|
||||
if (!tuple_data_type)
|
||||
|
2
tests/queries/0_stateless/03142_untuple_crash.sql
Normal file
2
tests/queries/0_stateless/03142_untuple_crash.sql
Normal file
@ -0,0 +1,2 @@
|
||||
SET allow_experimental_analyzer=1;
|
||||
SELECT untuple(x -> 0) -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
|
Loading…
Reference in New Issue
Block a user