mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Avoid stack overflow in materialized views, part 4: correct checks
This commit is contained in:
parent
cc3feb36a6
commit
625d03d8c2
@ -79,6 +79,15 @@ bool StorageID::operator<(const StorageID & rhs) const
|
||||
return !hasUUID();
|
||||
}
|
||||
|
||||
bool StorageID::operator==(const StorageID & rhs) const
|
||||
{
|
||||
assertNotEmpty();
|
||||
if (!hasUUID() && !rhs.hasUUID())
|
||||
return std::tie(database_name, table_name) == std::tie(rhs.database_name, rhs.table_name);
|
||||
else
|
||||
return hasUUID() && rhs.hasUUID() && uuid == rhs.uuid;
|
||||
}
|
||||
|
||||
String StorageID::getFullTableName() const
|
||||
{
|
||||
return backQuoteIfNeed(getDatabaseName()) + "." + backQuoteIfNeed(table_name);
|
||||
|
@ -68,6 +68,7 @@ struct StorageID
|
||||
return uuid != UUIDHelpers::Nil;
|
||||
}
|
||||
|
||||
bool operator==(const StorageID & rhs) const;
|
||||
bool operator<(const StorageID & rhs) const;
|
||||
|
||||
void assertNotEmpty() const
|
||||
|
Loading…
Reference in New Issue
Block a user