mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Fix crash with untuple and unresolved lambda
This commit is contained in:
parent
e6f97fd4c7
commit
10fb28c6ea
@ -5725,6 +5725,10 @@ ProjectionNames QueryAnalyzer::resolveFunction(QueryTreeNodePtr & node, Identifi
|
|||||||
checkFunctionNodeHasEmptyNullsAction(function_node);
|
checkFunctionNodeHasEmptyNullsAction(function_node);
|
||||||
|
|
||||||
const auto & untuple_argument = function_arguments[0];
|
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();
|
auto result_type = untuple_argument->getResultType();
|
||||||
const auto * tuple_data_type = typeid_cast<const DataTypeTuple *>(result_type.get());
|
const auto * tuple_data_type = typeid_cast<const DataTypeTuple *>(result_type.get());
|
||||||
if (!tuple_data_type)
|
if (!tuple_data_type)
|
||||||
|
1
tests/queries/0_stateless/03142_untuple_crash.sql
Normal file
1
tests/queries/0_stateless/03142_untuple_crash.sql
Normal file
@ -0,0 +1 @@
|
|||||||
|
SELECT untuple(x -> 0) -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
|
Loading…
Reference in New Issue
Block a user