You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2020/08/11 07:53:55 UTC
[shardingsphere] branch master updated: support mysql store
procedure create, alter, drop and call statement (#6771)
This is an automated email from the ASF dual-hosted git repository.
panjuan 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 f3322ee support mysql store procedure create, alter, drop and call statement (#6771)
f3322ee is described below
commit f3322ee0bdcb32212512276210c922ce8397b2ec
Author: DuanZhengqiang <st...@gmail.com>
AuthorDate: Tue Aug 11 02:53:42 2020 -0500
support mysql store procedure create, alter, drop and call statement (#6771)
* support mysql store procedure create, alter, drop and call
* modify code format
---
.../parser/binder/SQLStatementContextFactory.java | 5 +
.../binder/statement/dml/CallStatementContext.java | 32 ++++
.../src/main/antlr4/imports/mysql/BaseRule.g4 | 12 ++
.../src/main/antlr4/imports/mysql/DDLStatement.g4 | 170 ++++++++++++++++++++-
.../src/main/antlr4/imports/mysql/DMLStatement.g4 | 2 +-
.../sql/parser/autogen/MySQLStatement.g4 | 3 +
.../parser/mysql/visitor/impl/MySQLDDLVisitor.java | 21 +++
.../sql/parser/core/visitor/VisitorRule.java | 6 +
.../sql/statement/ddl/AlterProcedureStatement.java | 29 ++++
.../statement/ddl/CreateProcedureStatement.java | 29 ++++
.../sql/statement/ddl/DropProcedureStatement.java | 24 +++
11 files changed, 329 insertions(+), 4 deletions(-)
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/SQLStatementContextFactory.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/SQLStatementContextFactory.java
index 0ed84cf..d0c6217 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/SQLStatementContextFactory.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/SQLStatementContextFactory.java
@@ -36,6 +36,7 @@ import org.apache.shardingsphere.sql.parser.binder.statement.ddl.CreateTableStat
import org.apache.shardingsphere.sql.parser.binder.statement.ddl.DropIndexStatementContext;
import org.apache.shardingsphere.sql.parser.binder.statement.ddl.DropTableStatementContext;
import org.apache.shardingsphere.sql.parser.binder.statement.ddl.TruncateStatementContext;
+import org.apache.shardingsphere.sql.parser.binder.statement.dml.CallStatementContext;
import org.apache.shardingsphere.sql.parser.binder.statement.dml.DeleteStatementContext;
import org.apache.shardingsphere.sql.parser.binder.statement.dml.InsertStatementContext;
import org.apache.shardingsphere.sql.parser.binder.statement.dml.SelectStatementContext;
@@ -58,6 +59,7 @@ import org.apache.shardingsphere.sql.parser.sql.statement.ddl.DDLStatement;
import org.apache.shardingsphere.sql.parser.sql.statement.ddl.DropIndexStatement;
import org.apache.shardingsphere.sql.parser.sql.statement.ddl.DropTableStatement;
import org.apache.shardingsphere.sql.parser.sql.statement.ddl.TruncateStatement;
+import org.apache.shardingsphere.sql.parser.sql.statement.dml.CallStatement;
import org.apache.shardingsphere.sql.parser.sql.statement.dml.DMLStatement;
import org.apache.shardingsphere.sql.parser.sql.statement.dml.DeleteStatement;
import org.apache.shardingsphere.sql.parser.sql.statement.dml.InsertStatement;
@@ -110,6 +112,9 @@ public final class SQLStatementContextFactory {
if (sqlStatement instanceof InsertStatement) {
return new InsertStatementContext(schemaMetaData, parameters, (InsertStatement) sqlStatement);
}
+ if (sqlStatement instanceof CallStatement) {
+ return new CallStatementContext((CallStatement) sqlStatement);
+ }
throw new UnsupportedOperationException(String.format("Unsupported SQL statement `%s`", sqlStatement.getClass().getSimpleName()));
}
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/statement/dml/CallStatementContext.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/statement/dml/CallStatementContext.java
new file mode 100644
index 0000000..bb6f47e
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/statement/dml/CallStatementContext.java
@@ -0,0 +1,32 @@
+/*
+ * 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.sql.parser.binder.statement.dml;
+
+import lombok.Getter;
+import lombok.ToString;
+import org.apache.shardingsphere.sql.parser.binder.statement.CommonSQLStatementContext;
+import org.apache.shardingsphere.sql.parser.sql.statement.dml.CallStatement;
+
+@Getter
+@ToString(callSuper = true)
+public final class CallStatementContext extends CommonSQLStatementContext<CallStatement> {
+
+ public CallStatementContext(final CallStatement sqlStatement) {
+ super(sqlStatement);
+ }
+}
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/BaseRule.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/BaseRule.g4
index 6b0122b..d6a54c7 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/BaseRule.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/BaseRule.g4
@@ -614,3 +614,15 @@ pattern
connectionId_
: NUMBER_
;
+
+labelName
+ : identifier
+ ;
+
+cursorName
+ : identifier
+ ;
+
+conditionName
+ : identifier
+ ;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DDLStatement.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DDLStatement.g4
index 9c9baf4..4056dd8 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DDLStatement.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DDLStatement.g4
@@ -17,7 +17,7 @@
grammar DDLStatement;
-import Symbol, Keyword, MySQLKeyword, Literals, BaseRule, DMLStatement;
+import Symbol, Keyword, MySQLKeyword, Literals, BaseRule, DMLStatement, DALStatement;
createTable
: CREATE TEMPORARY? TABLE notExistClause_ tableName (createDefinitionClause? tableOptions_? partitionClause? duplicateAsQueryExpression? | createLikeClause)
@@ -578,7 +578,7 @@ timestampValue
;
routineBody
- : NOT_SUPPORT_
+ : simpleStatement | compoundStatement
;
serverOption_
@@ -600,9 +600,173 @@ routineOption_
;
procedureParameter_
- : ( IN | OUT | INOUT ) identifier dataType
+ : (IN | OUT | INOUT)? identifier dataType
;
fileSizeLiteral_
: FILESIZE_LITERAL | numberLiterals
+ ;
+
+simpleStatement
+ : validStatement
+ ;
+
+compoundStatement
+ : beginStatement
+ ;
+
+validStatement
+ : (createTable | alterTable | dropTable | truncateTable
+ | insert | replace | update | delete | select
+ | setVariable | beginStatement | declareStatement | flowControlStatement | cursorStatement | conditionHandlingStatement) SEMI_?
+ ;
+
+beginStatement
+ : (labelName COLON_)? BEGIN validStatement* END labelName? SEMI_?
+ ;
+
+declareStatement
+ : DECLARE variable (COMMA_ variable)* dataType (DEFAULT simpleExpr)*
+ ;
+
+flowControlStatement
+ : caseStatement | ifStatement | iterateStatement | leaveStatement | loopStatement | repeatStatement | returnStatement | whileStatement
+ ;
+
+caseStatement
+ : CASE expr?
+ (WHEN expr THEN validStatement+)+
+ (ELSE validStatement+)?
+ END CASE
+ ;
+
+ifStatement
+ : IF expr THEN validStatement+
+ (ELSEIF expr THEN validStatement+)*
+ (ELSE validStatement+)?
+ END IF
+ ;
+
+iterateStatement
+ : ITERATE labelName
+ ;
+
+leaveStatement
+ : LEAVE labelName
+ ;
+
+loopStatement
+ : (labelName COLON_)? LOOP
+ validStatement+
+ END LOOP labelName?
+ ;
+
+repeatStatement
+ : (labelName COLON_)? REPEAT
+ validStatement+
+ UNTIL expr
+ END REPEAT labelName?
+ ;
+
+returnStatement
+ : RETURN expr
+ ;
+
+whileStatement
+ : (labelName COLON_)? WHILE expr DO
+ validStatement+
+ END WHILE labelName?
+ ;
+
+cursorStatement
+ : cursorCloseStatement | cursorDeclareStatement | cursorFetchStatement | cursorOpenStatement
+ ;
+
+cursorCloseStatement
+ : CLOSE cursorName
+ ;
+
+cursorDeclareStatement
+ : DECLARE cursorName CURSOR FOR select
+ ;
+
+cursorFetchStatement
+ : FETCH ((NEXT)? FROM)? cursorName INTO variable (COMMA_ variable)*
+ ;
+
+cursorOpenStatement
+ : OPEN cursorName
+ ;
+
+conditionHandlingStatement
+ : declareConditionStatement | declareHandlerStatement | getDiagnosticsStatement | resignalStatement | signalStatement
+ ;
+
+declareConditionStatement
+ : DECLARE conditionName CONDITION FOR conditionValue
+ ;
+
+declareHandlerStatement
+ : DECLARE handlerAction HANDLER FOR conditionValue (COMMA_ conditionValue)* validStatement
+ ;
+
+getDiagnosticsStatement
+ : GET (CURRENT | STACKED)? DIAGNOSTICS
+ ((statementInformationItem (COMMA_ statementInformationItem)*)
+ | (CONDITION conditionNumber conditionInformationItem (COMMA_ conditionInformationItem)*))
+ ;
+
+statementInformationItem
+ : variable EQ_ statementInformationItemName
+ ;
+
+conditionInformationItem
+ : variable EQ_ conditionInformationItemName
+ ;
+
+conditionNumber
+ : variable | numberLiterals
+ ;
+
+statementInformationItemName
+ : NUMBER
+ | ROW_COUNT
+ ;
+
+conditionInformationItemName
+ : CLASS_ORIGIN
+ | SUBCLASS_ORIGIN
+ | RETURNED_SQLSTATE
+ | MESSAGE_TEXT
+ | MYSQL_ERRNO
+ | CONSTRAINT_CATALOG
+ | CONSTRAINT_SCHEMA
+ | CONSTRAINT_NAME
+ | CATALOG_NAME
+ | SCHEMA_NAME
+ | TABLE_NAME
+ | COLUMN_NAME
+ | CURSOR_NAME
+ ;
+
+handlerAction
+ : CONTINUE | EXIT | UNDO
+ ;
+
+conditionValue
+ : numberLiterals | SQLSTATE (VALUE)? stringLiterals | conditionName | SQLWARNING | NOT FOUND | SQLEXCEPTION
+ ;
+
+resignalStatement
+ : RESIGNAL conditionValue?
+ (SET signalInformationItem (COMMA_ signalInformationItem)*)?
+ ;
+
+signalStatement
+ : SIGNAL conditionValue
+ (SET signalInformationItem (COMMA_ signalInformationItem)*)?
+ ;
+
+signalInformationItem
+ : conditionInformationItemName EQ_ expr
;
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DMLStatement.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DMLStatement.g4
index 4547b2f..f3889f7 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DMLStatement.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/imports/mysql/DMLStatement.g4
@@ -222,7 +222,7 @@ projections
;
projection
- : expr (AS? alias)? | qualifiedShorthand
+ : expr (AS? alias)? (INTO columnName)? | qualifiedShorthand
;
unqualifiedShorthand
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/MySQLStatement.g4 b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/MySQLStatement.g4
index 3813121..7bc2f6f 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/MySQLStatement.g4
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/antlr4/org/apache/shardingsphere/sql/parser/autogen/MySQLStatement.g4
@@ -34,6 +34,9 @@ execute
| truncateTable
| createIndex
| dropIndex
+ | createProcedure
+ | alterProcedure
+ | dropProcedure
| setTransaction
| beginTransaction
| setAutoCommit
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/impl/MySQLDDLVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/impl/MySQLDDLVisitor.java
index bb67db9..558b38d 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/impl/MySQLDDLVisitor.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/impl/MySQLDDLVisitor.java
@@ -23,6 +23,7 @@ import org.apache.shardingsphere.sql.parser.api.ASTNode;
import org.apache.shardingsphere.sql.parser.api.visitor.statement.DDLVisitor;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.AddColumnSpecificationContext;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.AlterDefinitionClauseContext;
+import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.AlterProcedureContext;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.AlterSpecificationContext;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.AlterTableContext;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.ChangeColumnSpecificationContext;
@@ -34,12 +35,14 @@ import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.CreateD
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.CreateDefinitionContext;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.CreateIndexContext;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.CreateLikeClauseContext;
+import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.CreateProcedureContext;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.CreateTableContext;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.CreateViewContext;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.DropColumnSpecificationContext;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.DropDatabaseContext;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.DropIndexContext;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.DropPrimaryKeySpecificationContext;
+import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.DropProcedureContext;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.DropTableContext;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.DropViewContext;
import org.apache.shardingsphere.sql.parser.autogen.MySQLStatementParser.FirstOrAfterColumnContext;
@@ -71,13 +74,16 @@ import org.apache.shardingsphere.sql.parser.sql.segment.ddl.index.IndexSegment;
import org.apache.shardingsphere.sql.parser.sql.segment.dml.column.ColumnSegment;
import org.apache.shardingsphere.sql.parser.sql.segment.generic.DataTypeSegment;
import org.apache.shardingsphere.sql.parser.sql.segment.generic.table.SimpleTableSegment;
+import org.apache.shardingsphere.sql.parser.sql.statement.ddl.AlterProcedureStatement;
import org.apache.shardingsphere.sql.parser.sql.statement.ddl.AlterTableStatement;
import org.apache.shardingsphere.sql.parser.sql.statement.ddl.CreateDatabaseStatement;
import org.apache.shardingsphere.sql.parser.sql.statement.ddl.CreateIndexStatement;
+import org.apache.shardingsphere.sql.parser.sql.statement.ddl.CreateProcedureStatement;
import org.apache.shardingsphere.sql.parser.sql.statement.ddl.CreateTableStatement;
import org.apache.shardingsphere.sql.parser.sql.statement.ddl.CreateViewStatement;
import org.apache.shardingsphere.sql.parser.sql.statement.ddl.DropDatabaseStatement;
import org.apache.shardingsphere.sql.parser.sql.statement.ddl.DropIndexStatement;
+import org.apache.shardingsphere.sql.parser.sql.statement.ddl.DropProcedureStatement;
import org.apache.shardingsphere.sql.parser.sql.statement.ddl.DropTableStatement;
import org.apache.shardingsphere.sql.parser.sql.statement.ddl.DropViewStatement;
import org.apache.shardingsphere.sql.parser.sql.statement.ddl.RenameTableStatement;
@@ -411,4 +417,19 @@ public final class MySQLDDLVisitor extends MySQLVisitor implements DDLVisitor {
}
return result;
}
+
+ @Override
+ public ASTNode visitCreateProcedure(final CreateProcedureContext ctx) {
+ return new CreateProcedureStatement();
+ }
+
+ @Override
+ public ASTNode visitAlterProcedure(final AlterProcedureContext ctx) {
+ return new AlterProcedureStatement();
+ }
+
+ @Override
+ public ASTNode visitDropProcedure(final DropProcedureContext ctx) {
+ return new DropProcedureStatement();
+ }
}
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/visitor/VisitorRule.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/visitor/VisitorRule.java
index 7406836..f1a81ad 100644
--- a/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/visitor/VisitorRule.java
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/visitor/VisitorRule.java
@@ -51,6 +51,12 @@ public enum VisitorRule {
ALTER_INDEX("AlterIndex", SQLStatementType.DDL),
DROP_INDEX("DropIndex", SQLStatementType.DDL),
+
+ CREATE_PROCEDURE("CreateProcedure", SQLStatementType.DDL),
+
+ ALTER_PROCEDURE("AlterProcedure", SQLStatementType.DDL),
+
+ DROP_PROCEDURE("DropProcedure", SQLStatementType.DDL),
SET_TRANSACTION("SetTransaction", SQLStatementType.TCL),
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/statement/ddl/AlterProcedureStatement.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/statement/ddl/AlterProcedureStatement.java
new file mode 100644
index 0000000..17fbf27
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/statement/ddl/AlterProcedureStatement.java
@@ -0,0 +1,29 @@
+/*
+ * 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.sql.parser.sql.statement.ddl;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+
+/**
+ * Alter procedure statement.
+ */
+@RequiredArgsConstructor
+@Getter
+public final class AlterProcedureStatement extends DDLStatement {
+}
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/statement/ddl/CreateProcedureStatement.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/statement/ddl/CreateProcedureStatement.java
new file mode 100644
index 0000000..21be9a1
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/statement/ddl/CreateProcedureStatement.java
@@ -0,0 +1,29 @@
+/*
+ * 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.sql.parser.sql.statement.ddl;
+
+import lombok.Getter;
+import lombok.RequiredArgsConstructor;
+
+/**
+ * Create procedure statement.
+ */
+@RequiredArgsConstructor
+@Getter
+public final class CreateProcedureStatement extends DDLStatement {
+}
diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/statement/ddl/DropProcedureStatement.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/statement/ddl/DropProcedureStatement.java
new file mode 100644
index 0000000..6f34d7f
--- /dev/null
+++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/statement/ddl/DropProcedureStatement.java
@@ -0,0 +1,24 @@
+/*
+ * 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.sql.parser.sql.statement.ddl;
+
+/**
+ * Drop procedure statement.
+ */
+public final class DropProcedureStatement extends DDLStatement {
+}