thswlsqls opened a new pull request, #39873:
URL: https://github.com/apache/shardingsphere/pull/39873
Fixes #39872.
Changes proposed in this pull request:
- Fix the `SQL_HINT` lexer token in the shadow DistSQL grammar: it was
declared as `S I M P L E UL_ H I N T`, so it matched `SIMPLE_HINT` instead of
`SQL_HINT`. As a result `TYPE(NAME=SQL_HINT)` was rejected with a syntax error
while the sibling built-in types `VALUE_MATCH` and `REGEX_MATCH` parsed
unquoted. The quoted form `TYPE(NAME='SQL_HINT')` takes the `STRING_` branch
and was unaffected.
- This completes #23972, which renamed the algorithm from `SIMPLE_HINT` to
`SQL_HINT` but updated only the token name. No registered `ShadowAlgorithm`
type matches `SIMPLE_HINT`, so no working statement is affected.
- Side effect: `sql_hint` becomes a keyword and `simple_hint` is released
to `IDENTIFIER_`; the documented shadow reserved words do not list built-in
algorithm types, so `reserved-word.md` needs no update.
- Add a parser IT case for `ALTER DEFAULT SHADOW ALGORITHM
TYPE(NAME=SQL_HINT)` under `test/it/parser`, following #39465. It fails with
`SQLParsingException` before the grammar fix and passes after it.
- Verified with repository-wide `spotless:check`, `checkstyle:check`,
`apache-rat:check` (`-Pcheck`) and `install -pl
features/shadow/distsql/parser,test/it/parser -am` (`InternalDistSQLParserIT`
255/255); full `clean install` not run.
AI assistance: Claude Code drafted the grammar change and the parser IT case
in `features/shadow/distsql/parser` and `test/it/parser`; I reviewed and
verified every line.
---
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`.
- [ ] I have made corresponding changes to the documentation.
- [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]