diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/ShardingSphereMetaData.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/ShardingSphereMetaData.java index 79102546f1330..edc56a025b2ec 100644 --- a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/ShardingSphereMetaData.java +++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/ShardingSphereMetaData.java @@ -103,8 +103,7 @@ public void addDatabase(final String databaseName, final DatabaseType protocolTy * @param databaseName database name */ public void dropDatabase(final String databaseName) { - ShardingSphereDatabase toBeRemovedDatabase = databases.remove(databaseName.toLowerCase()); - closeResources(toBeRemovedDatabase); + closeResources(databases.remove(databaseName.toLowerCase())); } private void closeResources(final ShardingSphereDatabase database) {