Try fix crash.

This commit is contained in:
Nikolai Kochetov 2021-09-20 13:36:01 +03:00
parent 4eba3fcc8a
commit 729e530fe7

View File

@ -404,6 +404,11 @@ Chain buildPushingToViewsDrain(
InterpreterInsertQuery interpreter(nullptr, insert_context, false, false, false);
out = interpreter.buildChain(inner_table, inner_metadata_snapshot, insert_columns, view_runtime_data);
out.addStorageHolder(inner_table);
if (const auto * mv = dynamic_cast<const StorageMaterializedView *>(inner_table.get()))
{
if (auto inner_mv_table = mv->tryGetTargetTable())
out.addStorageHolder(inner_mv_table);
}
}
else if (auto * live_view = dynamic_cast<StorageLiveView *>(dependent_table.get()))
{