Try nut update scalars for only_analyze.

This commit is contained in:
Nikolai Kochetov 2020-04-30 20:37:44 +03:00 committed by Alexey Milovidov
parent 5cc0d5e537
commit 66111a6744
2 changed files with 1 additions and 5 deletions

View File

@ -92,10 +92,6 @@ PushingToViewsBlockOutputStream::PushingToViewsBlockOutputStream(
views.emplace_back(ViewInfo{std::move(query), database_table, std::move(out)});
}
/// Remove calculated scalar subquery results, because they can be calculated for real, not substituted tables.
if (views_context && views_context->hasQueryContext())
views_context->getQueryContext().dropScalars();
/// Do not push to destination table if the flag is set
if (!no_destination)
{

View File

@ -314,7 +314,7 @@ InterpreterSelectQuery::InterpreterSelectQuery(
options, joined_tables.tablesWithColumns(), required_result_column_names, table_join);
/// Save scalar sub queries's results in the query context
if (context->hasQueryContext())
if (!options.only_analyze && context->hasQueryContext())
for (const auto & it : syntax_analyzer_result->getScalars())
context->getQueryContext().addScalar(it.first, it.second);