提交 abef634d 编写于 作者: N Nikolai Kochetov 提交者: Alexey Milovidov

Fix scalars for MV.

上级 e41e998f
......@@ -93,6 +93,10 @@ 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->hasQueryContext())
views_context->getQueryContext().dropScalars();
/// Do not push to destination table if the flag is set
if (!no_destination)
{
......
......@@ -885,6 +885,12 @@ bool Context::hasScalar(const String & name) const
}
void Context::dropScalars()
{
scalars.clear();
}
StoragePtr Context::executeTableFunction(const ASTPtr & table_expression)
{
/// Slightly suboptimal.
......
......@@ -330,6 +330,7 @@ public:
const Block & getScalar(const String & name) const;
void addScalar(const String & name, const Block & block);
bool hasScalar(const String & name) const;
void dropScalars();
StoragePtr executeTableFunction(const ASTPtr & table_expression);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册