Fix crash in IdentifierResolveScope::dump()

This commit is contained in:
Dmitry Novik 2024-08-23 14:56:03 +02:00
parent 046f348fe7
commit 9a5552b5e6

View File

@ -4573,6 +4573,10 @@ void QueryAnalyzer::resolveTableFunction(QueryTreeNodePtr & table_function_node,
if (parametrized_view_storage) if (parametrized_view_storage)
{ {
/// Remove initial TableFunctionNode from the set. Otherwise it may lead to segfault
/// when IdentifierResolveScope::dump() is used.
scope.table_expressions_in_resolve_process.erase(table_function_node.get());
auto fake_table_node = std::make_shared<TableNode>(parametrized_view_storage, scope_context); auto fake_table_node = std::make_shared<TableNode>(parametrized_view_storage, scope_context);
fake_table_node->setAlias(table_function_node->getAlias()); fake_table_node->setAlias(table_function_node->getAlias());
table_function_node = fake_table_node; table_function_node = fake_table_node;