ThanoshanMV commented on a change in pull request #10558:
URL: https://github.com/apache/shardingsphere/pull/10558#discussion_r645956629



##########
File path: 
shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/impl/SQLServerDMLStatementSQLVisitor.java
##########
@@ -243,7 +243,7 @@ public ASTNode visitWithClause(final WithClauseContext ctx) 
{
         List<CteClauseContext> cteClauses = ctx.cteClause();
         Collection<CommonTableExpressionSegment> commonTableExpressions = new 
LinkedList<>();
         for (CteClauseContext cte : cteClauses) {
-            SubquerySegment subquery = new 
SubquerySegment(cte.start.getStartIndex(), cte.stop.getStopIndex(), 
(SQLServerSelectStatement) visit(cte.subquery()));
+            SubquerySegment subquery = new 
SubquerySegment(cte.subquery().start.getStartIndex(), 
cte.subquery().stop.getStopIndex(), (SQLServerSelectStatement) 
visit(cte.subquery()));

Review comment:
       While I was adding start and stop indices for all `subquery-expression` 
within `common-table-expression`, in the SQLServer visitor, the 
`SubquerySegment`'s start and stop indices are collected from 
`CommonTableExpressionSegment`'s start and stop indices. So I changed them from 
getting `CommonTableExpressionSegment`'s `SubquerySegment`. Shall I remove this 
modification?




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


Reply via email to