This is an automated email from the ASF dual-hosted git repository.
strongduanmu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new b2cc23b2782 test(e2e): close DDL table metadata result set (#38898)
b2cc23b2782 is described below
commit b2cc23b2782514be292940dbcf5517bde7992c0b
Author: Cong Hu <[email protected]>
AuthorDate: Tue Jun 23 19:06:10 2026 +0800
test(e2e): close DDL table metadata result set (#38898)
WHAT: Close the ResultSet returned by DatabaseMetaData#getTables when
DDLE2EIT checks table or view existence.
WHY: The DDL E2E metadata wait loop may poll table state repeatedly, and
leaking metadata ResultSets can exhaust database cursors.
HOW: Wrap getTables(...) in try-with-resources and keep the existing next()
result semantics.
---
.../org/apache/shardingsphere/test/e2e/sql/it/sql/ddl/DDLE2EIT.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/ddl/DDLE2EIT.java
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/ddl/DDLE2EIT.java
index a3cc20f9cba..5c4c705000f 100644
---
a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/ddl/DDLE2EIT.java
+++
b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/sql/it/sql/ddl/DDLE2EIT.java
@@ -320,7 +320,9 @@ class DDLE2EIT implements SQLE2EIT {
}
private boolean containsTable(final Connection connection, final String
tableName) throws SQLException {
- return connection.getMetaData().getTables(null, null, tableName, new
String[]{"TABLE", "VIEW"}).next();
+ try (ResultSet resultSet = connection.getMetaData().getTables(null,
null, tableName, new String[]{"TABLE", "VIEW"})) {
+ return resultSet.next();
+ }
}
@SuppressWarnings("CollectionWithoutInitialCapacity")