This is an automated email from the ASF dual-hosted git repository.
zhaojinchao 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 d6102dc3316 Remove duplicated replay on ShardingSphereStatement
(#31523)
d6102dc3316 is described below
commit d6102dc3316ccd8014f47887e2a58b6bb3402d94
Author: Liang Zhang <[email protected]>
AuthorDate: Sun Jun 2 11:55:54 2024 +0800
Remove duplicated replay on ShardingSphereStatement (#31523)
* Remove duplicated replay on ShardingSphereStatement
* Remove duplicated replay on ShardingSphereStatement
---
.../driver/jdbc/core/statement/ShardingSphereStatement.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java
b/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java
index 2437e7a54dc..c5d258b977f 100644
---
a/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java
+++
b/jdbc/src/main/java/org/apache/shardingsphere/driver/jdbc/core/statement/ShardingSphereStatement.java
@@ -128,6 +128,7 @@ public final class ShardingSphereStatement extends
AbstractStatementAdapter {
connection.getDatabaseConnectionManager().getConnectionContext().setCurrentDatabase(databaseName);
ShardingSphereDatabase database =
metaData.getDatabase(databaseName);
sqlStatementContext = queryContext.getSqlStatementContext();
+ clearStatements();
currentResultSet = executor.executeQuery(database, queryContext,
createDriverExecutionPrepareEngine(database), this, null,
(StatementReplayCallback<Statement>) (statements,
parameterSets) -> replay(statements));
statements.addAll(executor.getStatements());
@@ -219,7 +220,6 @@ public final class ShardingSphereStatement extends
AbstractStatementAdapter {
int result = executor.executeUpdate(database, queryContext,
createDriverExecutionPrepareEngine(database), updateCallback,
(StatementReplayCallback<Statement>) (statements,
parameterSets) -> replay(statements));
statements.addAll(executor.getStatements());
- replay(statements);
return result;
}