Skip to content

Commit

Permalink
remove unused catalogtype
Browse files Browse the repository at this point in the history
  • Loading branch information
Tishj committed Oct 28, 2023
1 parent 13cb836 commit aec4a8c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 19 deletions.
22 changes: 10 additions & 12 deletions src/catalog/catalog_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,18 +354,16 @@ DuckCatalog &CatalogSet::GetCatalog() {
void CatalogSet::CleanupEntry(CatalogEntry &catalog_entry) {
// destroy the backed up entry: it is no longer required
D_ASSERT(catalog_entry.parent);
if (catalog_entry.parent->type != CatalogType::UPDATED_ENTRY) {
lock_guard<mutex> write_lock(catalog.GetWriteLock());
lock_guard<mutex> lock(catalog_lock);
auto parent = catalog_entry.parent;
parent->child = std::move(catalog_entry.child);
if (parent->deleted && !parent->child && !parent->parent) {
auto mapping_entry = mapping.find(parent->name);
D_ASSERT(mapping_entry != mapping.end());
auto &entry = mapping_entry->second->index.GetEntry();
if (&entry == parent.get()) {
mapping.erase(mapping_entry);
}
lock_guard<mutex> write_lock(catalog.GetWriteLock());
lock_guard<mutex> lock(catalog_lock);
auto parent = catalog_entry.parent;
parent->child = std::move(catalog_entry.child);
if (parent->deleted && !parent->child && !parent->parent) {
auto mapping_entry = mapping.find(parent->name);
D_ASSERT(mapping_entry != mapping.end());
auto &entry = mapping_entry->second->index.GetEntry();
if (&entry == parent.get()) {
mapping.erase(mapping_entry);
}
}
}
Expand Down
5 changes: 0 additions & 5 deletions src/common/enum_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,6 @@ const char* EnumUtil::ToChars<CatalogType>(CatalogType value) {
return "MACRO_ENTRY";
case CatalogType::TABLE_MACRO_ENTRY:
return "TABLE_MACRO_ENTRY";
case CatalogType::UPDATED_ENTRY:
return "UPDATED_ENTRY";
case CatalogType::DELETED_ENTRY:
return "DELETED_ENTRY";
case CatalogType::DEPENDENCY_SET:
Expand Down Expand Up @@ -839,9 +837,6 @@ CatalogType EnumUtil::FromString<CatalogType>(const char *value) {
if (StringUtil::Equals(value, "TABLE_MACRO_ENTRY")) {
return CatalogType::TABLE_MACRO_ENTRY;
}
if (StringUtil::Equals(value, "UPDATED_ENTRY")) {
return CatalogType::UPDATED_ENTRY;
}
if (StringUtil::Equals(value, "DELETED_ENTRY")) {
return CatalogType::DELETED_ENTRY;
}
Expand Down
1 change: 0 additions & 1 deletion src/common/enums/catalog_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ string CatalogTypeToString(CatalogType type) {
return "Sequence";
case CatalogType::INVALID:
case CatalogType::DELETED_ENTRY:
case CatalogType::UPDATED_ENTRY:
case CatalogType::DEPENDENCY_ENTRY:
case CatalogType::DEPENDENCY_SET:
break;
Expand Down
1 change: 0 additions & 1 deletion src/include/duckdb/common/enums/catalog_type.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ enum class CatalogType : uint8_t {
TABLE_MACRO_ENTRY = 31,

// version info
UPDATED_ENTRY = 50,
DELETED_ENTRY = 51,

// dependency info
Expand Down

0 comments on commit aec4a8c

Please sign in to comment.