mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Merge pull request #56232 from evillique/fix-startup-crash
Fix a crash during table loading on startup
This commit is contained in:
commit
35d785592b
@ -78,10 +78,12 @@ static auto getQueryInterpreter(const ASTSubquery & subquery, ExecuteScalarSubqu
|
||||
subquery_settings.extremes = false;
|
||||
subquery_context->setSettings(subquery_settings);
|
||||
|
||||
if (subquery_context->hasQueryContext())
|
||||
{
|
||||
/// When execute `INSERT INTO t WITH ... SELECT ...`, it may lead to `Unknown columns`
|
||||
/// exception with this settings enabled(https://github.com/ClickHouse/ClickHouse/issues/52494).
|
||||
subquery_context->getQueryContext()->setSetting("use_structure_from_insertion_table_in_table_functions", false);
|
||||
if (!data.only_analyze && subquery_context->hasQueryContext())
|
||||
if (!data.only_analyze)
|
||||
{
|
||||
/// Save current cached scalars in the context before analyzing the query
|
||||
/// This is specially helpful when analyzing CTE scalars
|
||||
@ -89,6 +91,7 @@ static auto getQueryInterpreter(const ASTSubquery & subquery, ExecuteScalarSubqu
|
||||
for (const auto & it : data.scalars)
|
||||
context->addScalar(it.first, it.second);
|
||||
}
|
||||
}
|
||||
|
||||
ASTPtr subquery_select = subquery.children.at(0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user