Add function ASTCreateQuery::hasInnerUUIDs().

This commit is contained in:
Vitaly Baranov 2024-07-18 21:27:04 +02:00
parent cdadef7847
commit d7250c1d63
3 changed files with 9 additions and 1 deletions

View File

@ -1131,7 +1131,7 @@ void InterpreterCreateQuery::assertOrSetUUID(ASTCreateQuery & create, const Data
}
else
{
bool has_uuid = (create.uuid != UUIDHelpers::Nil) || (create.targets && create.targets->hasInnerUUIDs());
bool has_uuid = (create.uuid != UUIDHelpers::Nil) || create.hasInnerUUIDs();
if (has_uuid && !is_on_cluster && !internal)
{
/// We don't show the following error message either

View File

@ -563,6 +563,13 @@ UUID ASTCreateQuery::getTargetInnerUUID(ViewTarget::Kind target_kind) const
return UUIDHelpers::Nil;
}
bool ASTCreateQuery::hasInnerUUIDs() const
{
if (targets)
return targets->hasInnerUUIDs();
return false;
}
std::shared_ptr<ASTStorage> ASTCreateQuery::getTargetInnerEngine(ViewTarget::Kind target_kind) const
{
if (targets)

View File

@ -167,6 +167,7 @@ public:
StorageID getTargetTableID(ViewTarget::Kind target_kind) const;
bool hasTargetTableID(ViewTarget::Kind target_kind) const;
UUID getTargetInnerUUID(ViewTarget::Kind target_kind) const;
bool hasInnerUUIDs() const;
std::shared_ptr<ASTStorage> getTargetInnerEngine(ViewTarget::Kind target_kind) const;
void setTargetInnerEngine(ViewTarget::Kind target_kind, ASTPtr storage_def);