This is an automated email from the ASF dual-hosted git repository.

chengzhang 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 b4b54f31af3 Refactor SingleStandardRouteEngine code style (#27357)
b4b54f31af3 is described below

commit b4b54f31af3ac792ce54cebf1caf75e23c0ed53d
Author: Zhengqiang Duan <[email protected]>
AuthorDate: Fri Jul 21 18:36:43 2023 +0800

    Refactor SingleStandardRouteEngine code style (#27357)
---
 .../single/route/engine/SingleStandardRouteEngine.java               | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git 
a/kernel/single/core/src/main/java/org/apache/shardingsphere/single/route/engine/SingleStandardRouteEngine.java
 
b/kernel/single/core/src/main/java/org/apache/shardingsphere/single/route/engine/SingleStandardRouteEngine.java
index adf00977f8c..0b15bdaefef 100644
--- 
a/kernel/single/core/src/main/java/org/apache/shardingsphere/single/route/engine/SingleStandardRouteEngine.java
+++ 
b/kernel/single/core/src/main/java/org/apache/shardingsphere/single/route/engine/SingleStandardRouteEngine.java
@@ -29,10 +29,8 @@ import 
org.apache.shardingsphere.infra.util.exception.external.sql.type.generic.
 import org.apache.shardingsphere.single.exception.SingleTableNotFoundException;
 import org.apache.shardingsphere.single.rule.SingleRule;
 import org.apache.shardingsphere.sql.parser.sql.common.statement.SQLStatement;
-import 
org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.AlterTableStatement;
 import 
org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.CreateTableStatement;
 import 
org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.DDLStatement;
-import 
org.apache.shardingsphere.sql.parser.sql.common.statement.ddl.DropTableStatement;
 import 
org.apache.shardingsphere.sql.parser.sql.common.statement.dml.SelectStatement;
 import 
org.apache.shardingsphere.sql.parser.sql.dialect.handler.ddl.CreateTableStatementHandler;
 
@@ -98,8 +96,7 @@ public final class SingleStandardRouteEngine implements 
SingleRouteEngine {
                 String dataSourceName = rule.assignNewDataSourceName();
                 routeContext.getRouteUnits().add(new RouteUnit(new 
RouteMapper(dataSourceName, dataSourceName), Collections.singleton(new 
RouteMapper(table.getTableName(), table.getTableName()))));
             }
-        }
-        if (sqlStatement instanceof AlterTableStatement || sqlStatement 
instanceof DropTableStatement) {
+        } else {
             fillRouteContext(rule, routeContext, singleTables);
         }
     }

Reply via email to