Merge pull request #71367 from ClickHouse/better-code

Fix unused variables around WorkloadEntityStorageBase
This commit is contained in:
Nikita Mikhaylov 2024-11-01 19:06:18 +00:00 committed by GitHub
commit 436564e537
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -48,9 +48,9 @@ ASTPtr normalizeCreateWorkloadEntityQuery(const IAST & create_query)
/// Returns a type of a workload entity `ptr`
WorkloadEntityType getEntityType(const ASTPtr & ptr)
{
if (auto * res = typeid_cast<ASTCreateWorkloadQuery *>(ptr.get()))
if (auto * res = typeid_cast<ASTCreateWorkloadQuery *>(ptr.get()); res)
return WorkloadEntityType::Workload;
if (auto * res = typeid_cast<ASTCreateResourceQuery *>(ptr.get()))
if (auto * res = typeid_cast<ASTCreateResourceQuery *>(ptr.get()); res)
return WorkloadEntityType::Resource;
chassert(false);
return WorkloadEntityType::MAX;
@ -106,7 +106,7 @@ void forEachReference(
for (const String & resource : resources)
func(resource, res->getWorkloadName(), ReferenceType::ForResource);
}
if (auto * res = typeid_cast<ASTCreateResourceQuery *>(source_entity.get()))
if (auto * res = typeid_cast<ASTCreateResourceQuery *>(source_entity.get()); res)
{
// RESOURCE has no references to be validated, we allow mentioned disks to be created later
}