From 3455f79adf2835f58031f4983f761e181b6e4271 Mon Sep 17 00:00:00 2001 From: Liang Zhang Date: Fri, 5 Jul 2024 22:19:44 +0800 Subject: [PATCH] Refactor SQLBindEngine (#31990) --- .../infra/binder/engine/SQLBindEngine.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/engine/SQLBindEngine.java b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/engine/SQLBindEngine.java index f9c31c2236e0c..8c3e892f3562a 100644 --- a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/engine/SQLBindEngine.java +++ b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/engine/SQLBindEngine.java @@ -60,24 +60,24 @@ public final class SQLBindEngine { * @return SQL statement context */ public SQLStatementContext bind(final SQLStatement sqlStatement, final List params) { - SQLStatement buoundedSQLStatement = bind(sqlStatement, metaData, currentDatabaseName); + SQLStatement buoundedSQLStatement = bind(sqlStatement); return SQLStatementContextFactory.newInstance(metaData, params, buoundedSQLStatement, currentDatabaseName); } - private SQLStatement bind(final SQLStatement statement, final ShardingSphereMetaData metaData, final String currentDatabaseName) { + private SQLStatement bind(final SQLStatement statement) { if (hintValueContext.findHintDataSourceName().isPresent()) { return statement; } if (statement instanceof DMLStatement) { - return bindDMLStatement(statement, metaData, currentDatabaseName); + return bindDMLStatement(statement); } if (statement instanceof DDLStatement) { - return bindDDLStatement(statement, metaData, currentDatabaseName); + return bindDDLStatement(statement); } return statement; } - private static SQLStatement bindDMLStatement(final SQLStatement statement, final ShardingSphereMetaData metaData, final String currentDatabaseName) { + private SQLStatement bindDMLStatement(final SQLStatement statement) { if (statement instanceof SelectStatement) { return new SelectStatementBinder().bind((SelectStatement) statement, metaData, currentDatabaseName); } @@ -96,7 +96,7 @@ private static SQLStatement bindDMLStatement(final SQLStatement statement, final return statement; } - private static SQLStatement bindDDLStatement(final SQLStatement statement, final ShardingSphereMetaData metaData, final String currentDatabaseName) { + private SQLStatement bindDDLStatement(final SQLStatement statement) { if (statement instanceof CursorStatement) { return new CursorStatementBinder().bind((CursorStatement) statement, metaData, currentDatabaseName); }