terrymanu 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_r384357428
 
 

 ##########
 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:
   Is it correct for setVariableValue to variableValueSegmentList.get(0)?

----------------------------------------------------------------
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

Reply via email to