diff --git a/parser/sql/dialect/mysql/src/main/antlr4/imports/mysql/DMLStatement.g4 b/parser/sql/dialect/mysql/src/main/antlr4/imports/mysql/DMLStatement.g4 index bfd1de1e7b5f5..c85b7aba13029 100644 --- a/parser/sql/dialect/mysql/src/main/antlr4/imports/mysql/DMLStatement.g4 +++ b/parser/sql/dialect/mysql/src/main/antlr4/imports/mysql/DMLStatement.g4 @@ -163,7 +163,7 @@ querySpecification ; call - : CALL identifier (LP_ (expr (COMMA_ expr)*)? RP_)? + : CALL (owner DOT_)? identifier (LP_ (expr (COMMA_ expr)*)? RP_)? ; doStatement diff --git a/parser/sql/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/type/MySQLDMLStatementVisitor.java b/parser/sql/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/type/MySQLDMLStatementVisitor.java index b32aac425a77d..b6ca42d8630e3 100644 --- a/parser/sql/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/type/MySQLDMLStatementVisitor.java +++ b/parser/sql/dialect/mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/statement/type/MySQLDMLStatementVisitor.java @@ -63,7 +63,11 @@ public final class MySQLDMLStatementVisitor extends MySQLStatementVisitor implem public ASTNode visitCall(final CallContext ctx) { List params = new ArrayList<>(); ctx.expr().forEach(each -> params.add((ExpressionSegment) visit(each))); - return new MySQLCallStatement(ctx.identifier().getText(), params); + String procedureName = ctx.identifier().getText(); + if (null != ctx.owner()) { + procedureName = ctx.owner().getText().concat(".").concat(procedureName); + } + return new MySQLCallStatement(procedureName, params); } @Override diff --git a/test/it/parser/src/main/resources/case/dml/call.xml b/test/it/parser/src/main/resources/case/dml/call.xml index cec4e3986adea..0b7a46a1bbbad 100644 --- a/test/it/parser/src/main/resources/case/dml/call.xml +++ b/test/it/parser/src/main/resources/case/dml/call.xml @@ -143,4 +143,14 @@ + + + + + + + + + + diff --git a/test/it/parser/src/main/resources/sql/supported/dml/call.xml b/test/it/parser/src/main/resources/sql/supported/dml/call.xml index 58f882d69684f..5e285a74748e7 100644 --- a/test/it/parser/src/main/resources/sql/supported/dml/call.xml +++ b/test/it/parser/src/main/resources/sql/supported/dml/call.xml @@ -29,4 +29,5 @@ +