Skip to content

Commit

Permalink
Add a check for empty metadata path
Browse files Browse the repository at this point in the history
  • Loading branch information
evillique committed Nov 22, 2023
1 parent 58b51a7 commit 0949671
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Interpreters/DatabaseCatalog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,11 @@ String DatabaseCatalog::getPathForMetadata(const StorageID & table_id) const
if (!database_ptr)
throw Exception(ErrorCodes::LOGICAL_ERROR, "Failed to get metadata path from database {}", table_id.getDatabaseName());

return database_ptr->getMetadataPath() + escapeForFileName(table_id.getTableName()) + ".sql";
auto metadata_path = database_ptr->getMetadataPath();
if (metadata_path.empty())
throw Exception(ErrorCodes::LOGICAL_ERROR, "Empty metadata path in database {}", table_id.getDatabaseName());

return metadata_path + escapeForFileName(table_id.getTableName()) + ".sql";
}

void DatabaseCatalog::enqueueDroppedTableCleanup(StorageID table_id, StoragePtr table, String dropped_metadata_path, bool ignore_delay)
Expand Down

0 comments on commit 0949671

Please sign in to comment.