Fix bug with materialized_view and postgresql replication

This commit is contained in:
maks-buren630501 2022-08-30 15:13:22 +03:00
parent ba4dfe8308
commit af1cdb4aa2

View File

@ -340,7 +340,8 @@ Chain buildPushingToViewsChain(
chains.emplace_back(std::move(out));
/// Add the view to the query access info so it can appear in system.query_log
if (!no_destination)
/// hasQueryContext - for materialized tables with background replication process query context is not added
if (!no_destination && context->hasQueryContext())
{
context->getQueryContext()->addQueryAccessInfo(
backQuoteIfNeed(database_table.getDatabaseName()), views_data->views.back().runtime_stats->target_name, {}, "", database_table.getFullTableName());
@ -698,7 +699,6 @@ IProcessor::Status FinalizingViewsTransform::prepare()
output.finish();
return Status::Finished;
}
return Status::NeedData;
}