Update StorageMaterializedView.cpp

This commit is contained in:
tavplubix 2021-05-31 16:38:33 +03:00 committed by GitHub
parent 06dfb4a29a
commit 572dcbcbe2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -431,7 +431,12 @@ Strings StorageMaterializedView::getDataPaths() const
ActionLock StorageMaterializedView::getActionLock(StorageActionBlockType type)
{
return has_inner_table ? getTargetTable()->getActionLock(type) : ActionLock{};
if (has_inner_table)
{
if (auto target_table = tryGetTargetTable())
return target_table->getActionLock(type);
}
return ActionLock{};
}
void registerStorageMaterializedView(StorageFactory & factory)