From e038a0601bc545d774e10430298d88c3709384b3 Mon Sep 17 00:00:00 2001 From: RaigorJiang Date: Fri, 27 Oct 2023 11:54:30 +0800 Subject: [PATCH] Fix empty sql in SQL E2E --- .../distsql/handler/query/ShowShardingTableNodesExecutor.java | 2 +- .../shardingsphere/distsql/handler/query/RQLExecutor.java | 4 ++-- .../apache/shardingsphere/test/e2e/engine/type/DDLE2EIT.java | 4 ++-- .../apache/shardingsphere/test/e2e/engine/type/RALE2EIT.java | 4 ++-- .../apache/shardingsphere/test/e2e/engine/type/RDLE2EIT.java | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableNodesExecutor.java b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableNodesExecutor.java index 9272c1ccf957e..b0739c3fe1b32 100644 --- a/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableNodesExecutor.java +++ b/features/sharding/distsql/handler/src/main/java/org/apache/shardingsphere/sharding/distsql/handler/query/ShowShardingTableNodesExecutor.java @@ -34,7 +34,7 @@ import java.util.stream.Collectors; /** - * Result set for show sharding table nodes. + * Show sharding table nodes executor. */ public final class ShowShardingTableNodesExecutor implements RQLExecutor { diff --git a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/query/RQLExecutor.java b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/query/RQLExecutor.java index e6ecbc2bbc919..34f254861be81 100644 --- a/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/query/RQLExecutor.java +++ b/infra/distsql-handler/src/main/java/org/apache/shardingsphere/distsql/handler/query/RQLExecutor.java @@ -43,11 +43,11 @@ public interface RQLExecutor extends TypedSPI { /** * Get query result rows. * - * @param shardingSphereDatabase ShardingSphere database + * @param database database * @param sqlStatement SQL statement * @return query result rows */ - Collection getRows(ShardingSphereDatabase shardingSphereDatabase, T sqlStatement); + Collection getRows(ShardingSphereDatabase database, T sqlStatement); @Override Class getType(); diff --git a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/DDLE2EIT.java b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/DDLE2EIT.java index 1beba8c29f92c..4adfeaa176688 100644 --- a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/DDLE2EIT.java +++ b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/DDLE2EIT.java @@ -139,7 +139,7 @@ private void executeInitSQLs(final SingleE2EContainerComposer containerComposer, if (null == containerComposer.getAssertion().getInitialSQL().getSql()) { return; } - for (String each : Splitter.on(";").trimResults().splitToList(containerComposer.getAssertion().getInitialSQL().getSql())) { + for (String each : Splitter.on(";").trimResults().omitEmptyStrings().splitToList(containerComposer.getAssertion().getInitialSQL().getSql())) { try (PreparedStatement preparedStatement = connection.prepareStatement(each)) { preparedStatement.executeUpdate(); } @@ -159,7 +159,7 @@ private void executeDestroySQLs(final SingleE2EContainerComposer containerCompos if (null == containerComposer.getAssertion().getDestroySQL().getSql()) { return; } - for (String each : Splitter.on(";").trimResults().splitToList(containerComposer.getAssertion().getDestroySQL().getSql())) { + for (String each : Splitter.on(";").trimResults().omitEmptyStrings().splitToList(containerComposer.getAssertion().getDestroySQL().getSql())) { try (PreparedStatement preparedStatement = connection.prepareStatement(each)) { preparedStatement.executeUpdate(); } 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 cf2c3951ccb15..3bb870379f911 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 @@ -85,7 +85,7 @@ private void executeInitSQLs(final SingleE2EContainerComposer containerComposer, if (null == containerComposer.getAssertion().getInitialSQL().getSql()) { return; } - for (String each : Splitter.on(";").trimResults().splitToList(containerComposer.getAssertion().getInitialSQL().getSql())) { + for (String each : Splitter.on(";").trimResults().omitEmptyStrings().splitToList(containerComposer.getAssertion().getInitialSQL().getSql())) { try (PreparedStatement preparedStatement = connection.prepareStatement(each)) { preparedStatement.executeUpdate(); } @@ -105,7 +105,7 @@ private void executeDestroySQLs(final SingleE2EContainerComposer containerCompos if (null == containerComposer.getAssertion().getDestroySQL().getSql()) { return; } - for (String each : Splitter.on(";").trimResults().splitToList(containerComposer.getAssertion().getDestroySQL().getSql())) { + for (String each : Splitter.on(";").trimResults().omitEmptyStrings().splitToList(containerComposer.getAssertion().getDestroySQL().getSql())) { try (PreparedStatement preparedStatement = connection.prepareStatement(each)) { preparedStatement.executeUpdate(); } diff --git a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/RDLE2EIT.java b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/RDLE2EIT.java index f09565d594294..3e4d607ec3dcd 100644 --- a/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/RDLE2EIT.java +++ b/test/e2e/sql/src/test/java/org/apache/shardingsphere/test/e2e/engine/type/RDLE2EIT.java @@ -99,7 +99,7 @@ private void executeInitSQLs(final SingleE2EContainerComposer containerComposer, if (null == containerComposer.getAssertion().getInitialSQL() || null == containerComposer.getAssertion().getInitialSQL().getSql()) { return; } - for (String each : Splitter.on(";").trimResults().splitToList(containerComposer.getAssertion().getInitialSQL().getSql())) { + for (String each : Splitter.on(";").trimResults().omitEmptyStrings().splitToList(containerComposer.getAssertion().getInitialSQL().getSql())) { try (PreparedStatement preparedStatement = connection.prepareStatement(each)) { preparedStatement.executeUpdate(); Awaitility.await().pollDelay(2L, TimeUnit.SECONDS).until(() -> true); @@ -111,7 +111,7 @@ private void executeDestroySQLs(final SingleE2EContainerComposer containerCompos if (null == containerComposer.getAssertion().getDestroySQL().getSql()) { return; } - for (String each : Splitter.on(";").trimResults().splitToList(containerComposer.getAssertion().getDestroySQL().getSql())) { + for (String each : Splitter.on(";").trimResults().omitEmptyStrings().splitToList(containerComposer.getAssertion().getDestroySQL().getSql())) { try (PreparedStatement preparedStatement = connection.prepareStatement(each)) { preparedStatement.executeUpdate(); Awaitility.await().pollDelay(2L, TimeUnit.SECONDS).until(() -> true);