fudianchn commented on issue #34961:
URL: 
https://github.com/apache/shardingsphere/issues/34961#issuecomment-5081835251

   已按维护者认可的方向提交新 PR。
   
   
**根因**:`OpenGaussStatementVisitor#createLimitSegmentWhenRowCountOrOffsetAbsent` 
对 `LIMIT offset, row-count` 先访问 row-count、后访问 
offset;而参数下标按访问顺序赋值(`visitParameterMarker` 返回当时的 
`parameterMarkerSegments.size()`),导致词法第 1 个 `?`(offset) 取到 index 1、第 2 个 
`?`(row-count) 取到 index 0,下标反转。
   
   **修复**:先访问 offset、再访问 row-count,使下标与词法顺序一致(与 `DorisStatementVisitor` 
一致)。仅交换两行访问顺序,`LimitSegment` 构造不变。已补回归测试并通过 Spotless/Checkstyle/PMD/SpotBugs。
   
   鸣谢 @daguimu 在 #38647 的前期诊断。


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