Merge pull request #48904 from ClickHouse/fix_set_withzk_and_analyzer

Fix segfault when set is not built yet
This commit is contained in:
Alexey Milovidov 2023-04-21 15:14:23 +03:00 committed by GitHub
commit bd64a4a6fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View File

@ -123,6 +123,9 @@ public:
}
auto set = column_set->getData();
if (!set)
throw Exception(ErrorCodes::LOGICAL_ERROR, "Not-ready Set passed as the second argument for function '{}'", getName());
auto set_types = set->getDataTypes();
if (tuple && set_types.size() != 1 && set_types.size() == tuple->tupleSize())

View File

@ -940,7 +940,8 @@ bool ExpressionActions::checkColumnIsAlwaysFalse(const String & column_name) con
// Constant ColumnSet cannot be empty, so we only need to check non-constant ones.
if (const auto * column_set = checkAndGetColumn<const ColumnSet>(action.node->column.get()))
{
if (column_set->getData()->isCreated() && column_set->getData()->getTotalRowCount() == 0)
auto set = column_set->getData();
if (set && set->isCreated() && set->getTotalRowCount() == 0)
return true;
}
}

View File

@ -314,7 +314,7 @@ static void extractPathImpl(const ActionsDAG::Node & node, Paths & res, ContextP
return;
auto set = column_set->getData();
if (!set->isCreated())
if (!set || !set->isCreated())
return;
if (!set->hasExplicitSetElements())