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 cd20e2747cf Remove useless DoStatementContext (#32112)
cd20e2747cf is described below
commit cd20e2747cffaedeba88cd812df928ea759e624c
Author: Liang Zhang <[email protected]>
AuthorDate: Mon Jul 15 15:43:18 2024 +0800
Remove useless DoStatementContext (#32112)
---
.../statement/SQLStatementContextFactory.java | 6 +---
.../context/statement/dml/DoStatementContext.java | 36 ----------------------
2 files changed, 1 insertion(+), 41 deletions(-)
diff --git
a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/context/statement/SQLStatementContextFactory.java
b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/context/statement/SQLStatementContextFactory.java
index cb610b86d6e..fdfdf048fc2 100644
---
a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/context/statement/SQLStatementContextFactory.java
+++
b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/context/statement/SQLStatementContextFactory.java
@@ -53,7 +53,6 @@ import
org.apache.shardingsphere.infra.binder.context.statement.ddl.RenameTableS
import
org.apache.shardingsphere.infra.binder.context.statement.ddl.TruncateStatementContext;
import
org.apache.shardingsphere.infra.binder.context.statement.dml.CopyStatementContext;
import
org.apache.shardingsphere.infra.binder.context.statement.dml.DeleteStatementContext;
-import
org.apache.shardingsphere.infra.binder.context.statement.dml.DoStatementContext;
import
org.apache.shardingsphere.infra.binder.context.statement.dml.InsertStatementContext;
import
org.apache.shardingsphere.infra.binder.context.statement.dml.LoadDataStatementContext;
import
org.apache.shardingsphere.infra.binder.context.statement.dml.LoadXMLStatementContext;
@@ -159,16 +158,13 @@ public final class SQLStatementContextFactory {
if (sqlStatement instanceof CopyStatement) {
return new CopyStatementContext((CopyStatement) sqlStatement,
currentDatabaseName);
}
- if (sqlStatement instanceof DoStatement) {
- return new DoStatementContext((DoStatement) sqlStatement);
- }
if (sqlStatement instanceof LoadDataStatement) {
return new LoadDataStatementContext((LoadDataStatement)
sqlStatement, currentDatabaseName);
}
if (sqlStatement instanceof LoadXMLStatement) {
return new LoadXMLStatementContext((LoadXMLStatement)
sqlStatement, currentDatabaseName);
}
- if (sqlStatement instanceof CallStatement || sqlStatement instanceof
MergeStatement) {
+ if (sqlStatement instanceof CallStatement || sqlStatement instanceof
DoStatement || sqlStatement instanceof MergeStatement) {
return new UnknownSQLStatementContext(sqlStatement);
}
throw new UnsupportedSQLOperationException(String.format("Unsupported
SQL statement `%s`", sqlStatement.getClass().getSimpleName()));
diff --git
a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/context/statement/dml/DoStatementContext.java
b/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/context/statement/dml/DoStatementContext.java
deleted file mode 100644
index 4f56aef4a8a..00000000000
---
a/infra/binder/src/main/java/org/apache/shardingsphere/infra/binder/context/statement/dml/DoStatementContext.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.infra.binder.context.statement.dml;
-
-import
org.apache.shardingsphere.infra.binder.context.statement.CommonSQLStatementContext;
-import
org.apache.shardingsphere.sql.parser.statement.core.statement.dml.DoStatement;
-
-/**
- * Do statement context.
- */
-public final class DoStatementContext extends CommonSQLStatementContext {
-
- public DoStatementContext(final DoStatement sqlStatement) {
- super(sqlStatement);
- }
-
- @Override
- public DoStatement getSqlStatement() {
- return (DoStatement) super.getSqlStatement();
- }
-}