diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/extractor/util/RuleName.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/extractor/util/RuleName.java index 19971fe757d76848283c25eeb1f73f1572ce53cc..1748c0dd9e7ed940fe5f25621d7d9d77b18c1772 100644 --- a/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/extractor/util/RuleName.java +++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/extractor/util/RuleName.java @@ -241,6 +241,8 @@ public enum RuleName { SET_VARIABLE("SetVariable"), + SET("Set"), + CALL("Call"); private final String name; diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/visitor/ParseTreeVisitorFactory.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/visitor/ParseTreeVisitorFactory.java index 1e45bf65912dbdfe6012bf842890142070c78293..21c182ccf77fe7a401675c5e95ae69b6c88b6d09 100644 --- a/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/visitor/ParseTreeVisitorFactory.java +++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-engine/src/main/java/org/apache/shardingsphere/sql/parser/core/visitor/ParseTreeVisitorFactory.java @@ -55,7 +55,7 @@ public final class ParseTreeVisitorFactory { RuleName.DROP_ROLE.getName(), RuleName.SET_DEFAULT_ROLE.getName(), RuleName.SET_ROLE.getName(), RuleName.SET_PASSWORD.getName())); SQL_VISITOR_RULES.put("DALVisitor", Lists.newArrayList(RuleName.USE.getName(), RuleName.DESC.getName(), RuleName.SHOW_DATABASES.getName(), RuleName.SHOW_TABLES.getName(), RuleName.SHOW_TABLE_STATUS.getName(), RuleName.SHOW_COLUMNS.getName(), RuleName.SHOW_INDEX.getName(), - RuleName.SHOW_CREATE_TABLE.getName(), RuleName.SHOW_OTHER.getName(), RuleName.SET_VARIABLE.getName(), RuleName.CALL.getName())); + RuleName.SHOW_CREATE_TABLE.getName(), RuleName.SHOW_OTHER.getName(), RuleName.SET_VARIABLE.getName(), RuleName.SET.getName(), RuleName.CALL.getName())); } /** diff --git a/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/PostgreSQLDALVisitor.java b/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/PostgreSQLDALVisitor.java index 4cf2a0f26f32e8d498835978486eb596ec08af51..bd4e954154c8b5e562831ff124f94aa37e542982 100644 --- a/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/PostgreSQLDALVisitor.java +++ b/shardingsphere-sql-parser/shardingsphere-sql-parser-postgresql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/PostgreSQLDALVisitor.java @@ -17,6 +17,9 @@ package org.apache.shardingsphere.sql.parser.visitor.impl; +import org.apache.shardingsphere.sql.parser.autogen.PostgreSQLStatementParser.SetContext; +import org.apache.shardingsphere.sql.parser.sql.ASTNode; +import org.apache.shardingsphere.sql.parser.sql.statement.dal.dialect.mysql.SetStatement; import org.apache.shardingsphere.sql.parser.visitor.PostgreSQLVisitor; /** @@ -25,4 +28,9 @@ import org.apache.shardingsphere.sql.parser.visitor.PostgreSQLVisitor; * @author zhangliang */ public final class PostgreSQLDALVisitor extends PostgreSQLVisitor { + + @Override + public ASTNode visitSet(final SetContext ctx) { + return new SetStatement(); + } }