Skip to content

Commit

Permalink
Update CatalogMgr.java
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangm365 authored Sep 12, 2024
1 parent 22cdb61 commit 4386e83
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,10 @@ private void readUnlock() {
*/
public void createCatalog(CreateCatalogStmt stmt) throws UserException {
if (nameToCatalog.containsKey(stmt.getCatalogName())) {
LOG.warn("Catalog {} is already exist.", stmt.getCatalogName());
throw new DdlException("Catalog had already exist with name: " + stmt.getCatalogName());
if (stmt.isSetIfNotExists()) {
LOG.warn("Catalog {} is already exist.", stmt.getCatalogName());
throw new DdlException("Catalog had already exist with name: " + stmt.getCatalogName());
}
}

long id = Env.getCurrentEnv().getNextId();
Expand Down

0 comments on commit 4386e83

Please sign in to comment.