From 937a557280dd7511516ece450ae61bf22dfd39d6 Mon Sep 17 00:00:00 2001 From: Hongsheng Zhong Date: Thu, 26 Oct 2023 17:16:57 +0800 Subject: [PATCH] SQL E2E compatible with com.mysql:mysql-connector-j:8.0 (#28874) --- .../shardingsphere/test/e2e/engine/type/RALE2EIT.java | 3 ++- .../shardingsphere/test/e2e/engine/type/RQLE2EIT.java | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/RALE2EIT.java b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/RALE2EIT.java index c86fbc3739186..cf2c3951ccb15 100644 --- a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/RALE2EIT.java +++ b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/RALE2EIT.java @@ -124,7 +124,8 @@ private void assertResultSet(final SingleE2EContainerComposer containerComposer, } private void assertResultSet(final SingleE2EContainerComposer containerComposer, final Statement statement, final String sql) throws SQLException { - try (ResultSet resultSet = statement.executeQuery(sql)) { + statement.execute(sql); + try (ResultSet resultSet = statement.getResultSet()) { assertResultSet(containerComposer, resultSet); } } diff --git a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/RQLE2EIT.java b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/RQLE2EIT.java index 51b3151206477..8da1eff778174 100644 --- a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/RQLE2EIT.java +++ b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/RQLE2EIT.java @@ -59,10 +59,11 @@ void assertExecute(final AssertionTestParameter testParam) throws SQLException { } private void assertExecute(final SingleE2EContainerComposer containerComposer) throws SQLException { - try (Connection connection = containerComposer.getTargetDataSource().getConnection()) { - try ( - Statement statement = connection.createStatement(); - ResultSet resultSet = statement.executeQuery(containerComposer.getSQL())) { + try ( + Connection connection = containerComposer.getTargetDataSource().getConnection(); + Statement statement = connection.createStatement()) { + statement.execute(containerComposer.getSQL()); + try (ResultSet resultSet = statement.getResultSet()) { assertResultSet(containerComposer, resultSet); } }