beijing-penguin commented on a change in pull request #4477: Parse mysql
variable value for SET statement
URL:
https://github.com/apache/incubator-shardingsphere/pull/4477#discussion_r386088253
##########
File path:
shardingsphere-sql-parser/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/visitor/impl/MySQLDALVisitor.java
##########
@@ -145,14 +150,32 @@ public ASTNode visitShowOther(final ShowOtherContext
ctx) {
public ASTNode visitSetVariable(final SetVariableContext ctx) {
SetStatement result = new SetStatement();
if (null != ctx.variable()) {
- result.setVariable((VariableSegment) visit(ctx.variable()));
+ List<VariableContext> variableContextList = ctx.variable();
+ List<VariableSegment> variableSegmentList = new
ArrayList<VariableSegment>();
+ for (VariableContext variableContext : variableContextList) {
+ variableSegmentList.add((VariableSegment)
visit(variableContext));
+ }
+ result.setVariable(variableSegmentList.get(0));
Review comment:
re-design
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services