Merge pull request #24806 from ClickHouse/tavplubix-patch-2

Small improvement for StorageMaterializedView::getActionLock(...)
This commit is contained in:
tavplubix 2021-06-01 11:32:16 +03:00 committed by GitHub
commit 3dd7d252a9
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) 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) void registerStorageMaterializedView(StorageFactory & factory)