Merge pull request #71183 from Avogar/fix-weak-ptr-exception-dynamic

Fix bad_weak_ptr exception with Dynamic in functions comparison
This commit is contained in:
Pavel Kruglov 2024-11-01 11:04:49 +00:00 committed by GitHub
commit dd840b3db5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 3 deletions

View File

@ -1171,7 +1171,7 @@ public:
if (left_tuple && right_tuple)
{
auto func = FunctionToOverloadResolverAdaptor(std::make_shared<FunctionComparison<Op, Name>>(check_decimal_overflow));
auto func = std::make_shared<FunctionToOverloadResolverAdaptor>(std::make_shared<FunctionComparison<Op, Name>>(check_decimal_overflow));
bool has_nullable = false;
bool has_null = false;
@ -1181,7 +1181,7 @@ public:
{
ColumnsWithTypeAndName args = {{nullptr, left_tuple->getElements()[i], ""},
{nullptr, right_tuple->getElements()[i], ""}};
auto element_type = func.build(args)->getResultType();
auto element_type = func->build(args)->getResultType();
has_nullable = has_nullable || element_type->isNullable();
has_null = has_null || element_type->onlyNull();
}

View File

@ -211,7 +211,7 @@ namespace
ColumnsWithTypeAndName args = arguments;
args[0].column = args[0].column->cloneResized(input_rows_count)->convertToFullColumnIfConst();
auto impl = FunctionToOverloadResolverAdaptor(std::make_shared<FunctionTransform>()).build(args);
auto impl = std::make_shared<FunctionToOverloadResolverAdaptor>(std::make_shared<FunctionTransform>())->build(args);
return impl->execute(args, result_type, input_rows_count);
}

View File

@ -0,0 +1,6 @@
SET allow_experimental_dynamic_type = 1;
DROP TABLE IF EXISTS t0;
CREATE TABLE t0 (c0 Tuple(c1 Int,c2 Dynamic)) ENGINE = Memory();
SELECT 1 FROM t0 tx JOIN t0 ty ON tx.c0 = ty.c0;
DROP TABLE t0;