You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/07/22 01:16:32 UTC

[GitHub] [shardingsphere] jingshanglu commented on a change in pull request #6370: fix sql test

jingshanglu commented on a change in pull request #6370:
URL: https://github.com/apache/shardingsphere/pull/6370#discussion_r458477199



##########
File path: shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-mysql/src/main/java/org/apache/shardingsphere/sql/parser/mysql/visitor/impl/MySQLDMLVisitor.java
##########
@@ -470,7 +470,8 @@ private ASTNode createProjection(final ProjectionContext ctx, final AliasSegment
         }
         if (projection instanceof CommonExpressionSegment) {
             CommonExpressionSegment segment = (CommonExpressionSegment) projection;
-            ExpressionProjectionSegment result = new ExpressionProjectionSegment(segment.getStartIndex(), segment.getStopIndex(), segment.getText());
+            ExpressionProjectionSegment result = null == alias ? new ExpressionProjectionSegment(segment.getStartIndex(), segment.getStopIndex(), segment.getText())
+                    : new ExpressionProjectionSegment(segment.getStartIndex(), alias.getStopIndex(), segment.getText());

Review comment:
       > Do you think it is better to overwrite `getStopIndex()` of `ExpressionProjectionSegment ` with the stopIndex of its`aliasSegment`,
   
   Ok




----------------------------------------------------------------
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:
users@infra.apache.org