archyly commented on issue #17973:
URL: 
https://github.com/apache/shardingsphere/issues/17973#issuecomment-1409805053

   > I think I found the bug in 
`org.apache.shardingsphere.sql.parser.sqlserver.visitor.statement.impl.SQLServerStatementSQLVisitor`
   > 
   > 
https://github.com/apache/shardingsphere/blob/ed2ccd1951a48010587533d701d787c77e6f750e/shardingsphere-sql-parser/shardingsphere-sql-parser-dialect/shardingsphere-sql-parser-sqlserver/src/main/java/org/apache/shardingsphere/sql/parser/sqlserver/visitor/statement/impl/SQLServerStatementSQLVisitor.java#L789
   > 
   > ` ASTNode astNode = visit(ctx.expr(0));` change the 
`currentParameterIndex` then following code doen't use the `astNode` . it 
create a new one with the changed value `new 
ParameterMarkerLimitValueSegment(ctx.expr(0).start.getStartIndex(), 
ctx.expr(0).stop.getStopIndex(), getCurrentParameterIndex());` the 
getCurrentParameterIndex will return an increased one , maybe using the 
`astNode` to convert to the target astNode instead of creating a new one
   > missing the next line rowCount should also change to ` rowcount = new 
ParameterMarkerLimitValueSegment(ctx.expr(1).start.getStartIndex(), 
ctx.expr(1).stop.getStopIndex(), ((ParameterMarkerExpressionSegment) 
astNode).getParameterMarkerIndex());` and tested by my project
   
   Is there any sample code to fix this bug? I tried to compile the sharding 
source code,but there were some errors。thanks


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to