thswlsqls opened a new pull request, #39858:
URL: https://github.com/apache/shardingsphere/pull/39858
Fixes #39857.
Changes proposed in this pull request:
- Pass `stopOffset` before `startOffset` to the format string in
`ShardingValueOffsetException`, matching the placeholder order `stop offset %d
... start offset %d` of its own message template.
- Restores the contract documented for error code 20023 in
`docs/document/content/user-manual/error-code/sql-error-code.en.md` line 174.
The documentation and the template are already correct, so only the argument
order changes.
- The only caller, `ModShardingAlgorithm.cutShardingValue()`, already
passes the arguments in declared order; the constructor signature is unchanged.
- Aligns with the sibling `InvalidDatetimeFormatException` in the same
package, which reorders its arguments to match its template.
- Asserts error code, SQL state and message in
`ModShardingAlgorithmTest.assertPreciseDoShardingWhenOffsetOverload()`,
following the assertion style of #39372. The message assertion fails on master
with `stop offset 10 ... start offset 1`.
- Verified locally with spotless, checkstyle, apache-rat and `./mvnw
install -pl features/sharding/core -am`; no IT or E2E tests are affected.
AI assistance: Claude Code was used to draft the change and its unit test in
`features/sharding/core`. I reviewed, verified, and take responsibility for
every line submitted.
---
Before committing this PR, I'm sure that I have checked the following
options:
- [x] My code follows the [code of
conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/)
of this project.
- [x] I have self-reviewed the commit code.
- [ ] I have (or in comment I request) added corresponding labels for the
pull request.
- [ ] I have passed maven check locally : `./mvnw clean install -B -T1C
-Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`. Module-scoped instead: `./mvnw
spotless:apply -Pcheck -T1C -pl features/sharding/core`, `./mvnw
checkstyle:check -Pcheck -T1C -pl features/sharding/core`, `./mvnw
apache-rat:check -Pcheck -T1C -pl features/sharding/core` and `./mvnw install
-pl features/sharding/core -am -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip
-e` all passed.
- [ ] I have made corresponding changes to the documentation. Not needed:
`sql-error-code.en.md` and `.cn.md` already document the correct order for
error 20023.
- [x] I have added corresponding unit tests for my changes.
- [x] I have updated the Release Notes of the current development version.
For more details, see [Update Release
Note](https://shardingsphere.apache.org/community/en/involved/contribute/contributor/)
- [x] I have disclosed the tool and affected files or scope for any material
AI assistance, as required by the [AI-assisted contribution policy].
[AI-assisted contribution policy]:
https://github.com/apache/shardingsphere/blob/master/AI_POLICY.md
--
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]