thswlsqls opened a new pull request, #39871:
URL: https://github.com/apache/shardingsphere/pull/39871
Fixes #39870.
Changes proposed in this pull request:
- `ShardingSQLAuditor.audit()` compared
`disableAuditNames.contains(each.toLowerCase())`, lower-casing only the
configured auditor name while the hint value stays as written (`SQLHintUtils`
only trims), so an auditor name with an upper-case letter could not be disabled
by the hint, even with identical spelling.
- Wrap the hint names in `CaseInsensitiveSet` once per `audit()` call and
drop the manual `toLowerCase()`, so the comparison uses the same
case-insensitive semantics as `rule.getAuditors()` (`CaseInsensitiveMap` in
`ShardingRule`) on the next line.
- The set is created once outside the per-strategy loop to keep the
`@HighFrequencyInvocation` path free of per-iteration allocations.
- Fixed here rather than in `HintValueContext` because
`ShardingSQLAuditor` is the only consumer of `getDisableAuditNames()` and this
keeps `infra` untouched.
- Adds `assertAuditSuccessWithDisableAuditNamesInDifferentCase` and
`assertAuditSuccessWithAuditorNameContainingUpperCase` to
`ShardingSQLAuditorTest`; both fail before the fix.
- Verified locally with `./mvnw spotless:apply`, `checkstyle:check`,
`apache-rat:check` (`-Pcheck -pl features/sharding/core`) and `./mvnw install
-pl features/sharding/core -am` (879 tests in the module, 0 failures); E2E
cases in `test/e2e` were not run.
AI assistance: Claude Code was used to draft the change and its unit tests
in `features/sharding/core` (`ShardingSQLAuditor`, `ShardingSQLAuditorTest`)
and the `RELEASE-NOTES.md` entry. 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`. Ran the module-scoped equivalent
instead: `./mvnw install -pl features/sharding/core -am -B -T1C
-Dmaven.javadoc.skip -Dmaven.jacoco.skip -e` plus `spotless:apply`,
`checkstyle:check` and `apache-rat:check` with `-Pcheck -T1C -pl
features/sharding/core`.
- [ ] I have made corresponding changes to the documentation. The hint
syntax and YAML keys are unchanged; no documentation describes the case
handling.
- [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]