You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2025/05/22 15:49:19 UTC
(shardingsphere) branch master updated: Refactor StandardDatabaseConnector (#35486)
This is an automated email from the ASF dual-hosted git repository.
zhangliang 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 bc670b6727c Refactor StandardDatabaseConnector (#35486)
bc670b6727c is described below
commit bc670b6727c483dd07bc83087c270a19c834b865
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Thu May 22 23:49:13 2025 +0800
Refactor StandardDatabaseConnector (#35486)
* Refactor ShardingDQLResultMerger
* Refactor ShardingDQLResultMerger
* Refactor StandardDatabaseConnector
---
.../proxy/backend/connector/StandardDatabaseConnector.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/connector/StandardDatabaseConnector.java b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/connector/StandardDatabaseConnector.java
index 9899928c731..6d283a039aa 100644
--- a/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/connector/StandardDatabaseConnector.java
+++ b/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/connector/StandardDatabaseConnector.java
@@ -250,12 +250,12 @@ public final class StandardDatabaseConnector implements DatabaseConnector {
}
private ResultSet doExecuteFederation() {
- SQLStatement sqlStatement = queryContext.getSqlStatementContext().getSqlStatement();
- DialectDatabaseMetaData dialectDatabaseMetaData = new DatabaseTypeRegistry(sqlStatement.getDatabaseType()).getDialectDatabaseMetaData();
- boolean isReturnGeneratedKeys = sqlStatement instanceof InsertStatement && dialectDatabaseMetaData.getGeneratedKeyOption().isSupportReturnGeneratedKeys();
+ DialectDatabaseMetaData dialectDatabaseMetaData = new DatabaseTypeRegistry(queryContext.getSqlStatementContext().getDatabaseType()).getDialectDatabaseMetaData();
+ boolean isReturnGeneratedKeys = queryContext.getSqlStatementContext().getSqlStatement() instanceof InsertStatement
+ && dialectDatabaseMetaData.getGeneratedKeyOption().isSupportReturnGeneratedKeys();
DatabaseType protocolType = database.getProtocolType();
ProxyJDBCExecutorCallback callback = ProxyJDBCExecutorCallbackFactory.newInstance(driverType, protocolType, database.getResourceMetaData(),
- sqlStatement, this, isReturnGeneratedKeys, SQLExecutorExceptionHandler.isExceptionThrown(), true);
+ queryContext.getSqlStatementContext().getSqlStatement(), this, isReturnGeneratedKeys, SQLExecutorExceptionHandler.isExceptionThrown(), true);
DriverExecutionPrepareEngine<JDBCExecutionUnit, Connection> prepareEngine = createDriverExecutionPrepareEngine(isReturnGeneratedKeys, contextManager.getMetaDataContexts());
SQLFederationContext context = new SQLFederationContext(
false, queryContext, contextManager.getMetaDataContexts().getMetaData(), databaseConnectionManager.getConnectionSession().getProcessId());