fix debug build for gcc-9

This commit is contained in:
Nikita Mikhaylov 2020-03-16 12:16:14 +03:00
parent 930e6f24b1
commit b34d1dfc7d

View File

@ -137,7 +137,7 @@ void DatabaseCatalog::shutdown()
DatabaseAndTable DatabaseCatalog::tryGetByUUID(const UUID & uuid) const DatabaseAndTable DatabaseCatalog::tryGetByUUID(const UUID & uuid) const
{ {
assert(uuid != UUIDHelpers::Nil && 0 <= getFirstLevelIdx(uuid) && getFirstLevelIdx(uuid) < uuid_map.size()); assert(uuid != UUIDHelpers::Nil && getFirstLevelIdx(uuid) < uuid_map.size());
const UUIDToStorageMapPart & map_part = uuid_map[getFirstLevelIdx(uuid)]; const UUIDToStorageMapPart & map_part = uuid_map[getFirstLevelIdx(uuid)];
std::lock_guard lock{map_part.mutex}; std::lock_guard lock{map_part.mutex};
auto it = map_part.map.find(uuid); auto it = map_part.map.find(uuid);
@ -330,7 +330,7 @@ DatabasePtr DatabaseCatalog::getSystemDatabase() const
void DatabaseCatalog::addUUIDMapping(const UUID & uuid, DatabasePtr database, StoragePtr table) void DatabaseCatalog::addUUIDMapping(const UUID & uuid, DatabasePtr database, StoragePtr table)
{ {
assert(uuid != UUIDHelpers::Nil && 0 <= getFirstLevelIdx(uuid) && getFirstLevelIdx(uuid) < uuid_map.size()); assert(uuid != UUIDHelpers::Nil && getFirstLevelIdx(uuid) < uuid_map.size());
UUIDToStorageMapPart & map_part = uuid_map[getFirstLevelIdx(uuid)]; UUIDToStorageMapPart & map_part = uuid_map[getFirstLevelIdx(uuid)];
std::lock_guard lock{map_part.mutex}; std::lock_guard lock{map_part.mutex};
auto [_, inserted] = map_part.map.try_emplace(uuid, std::move(database), std::move(table)); auto [_, inserted] = map_part.map.try_emplace(uuid, std::move(database), std::move(table));
@ -340,7 +340,7 @@ void DatabaseCatalog::addUUIDMapping(const UUID & uuid, DatabasePtr database, St
void DatabaseCatalog::removeUUIDMapping(const UUID & uuid) void DatabaseCatalog::removeUUIDMapping(const UUID & uuid)
{ {
assert(uuid != UUIDHelpers::Nil && 0 <= getFirstLevelIdx(uuid) && getFirstLevelIdx(uuid) < uuid_map.size()); assert(uuid != UUIDHelpers::Nil && getFirstLevelIdx(uuid) < uuid_map.size());
UUIDToStorageMapPart & map_part = uuid_map[getFirstLevelIdx(uuid)]; UUIDToStorageMapPart & map_part = uuid_map[getFirstLevelIdx(uuid)];
std::lock_guard lock{map_part.mutex}; std::lock_guard lock{map_part.mutex};
if (!map_part.map.erase(uuid)) if (!map_part.map.erase(uuid))