tristaZero commented on a change in pull request #6370:
URL: https://github.com/apache/shardingsphere/pull/6370#discussion_r456775949
##########
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`,
----------------------------------------------------------------
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]