thswlsqls opened a new issue, #39872: URL: https://github.com/apache/shardingsphere/issues/39872
## Bug Report ### Which version of ShardingSphere did you use? master @ 101c3d56ccd (5.5.4-SNAPSHOT) ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy? Proxy ### Expected behavior `SQL_HINT` is one of the three built-in shadow algorithm types, so it should be usable without quotes, like `VALUE_MATCH` and `REGEX_MATCH`: ```sql ALTER DEFAULT SHADOW ALGORITHM TYPE(NAME=SQL_HINT); ``` ### Actual behavior The statement above is rejected with `You have an error in your SQL syntax`. Instead, the removed legacy spelling `TYPE(NAME=SIMPLE_HINT)` is accepted, then fails because no `ShadowAlgorithm` is registered for it. ### Reason analyze (If you can) In `features/shadow/distsql/parser/src/main/antlr4/imports/shadow/Keyword.g4` the `SQL_HINT` token is declared as `S I M P L E UL_ H I N T`, so it matches the text `SIMPLE_HINT` rather than `SQL_HINT`. #23972 renamed this algorithm from `SIMPLE_HINT` to `SQL_HINT` and updated the token name, but not the characters the token matches. `SQLHintShadowAlgorithm.getType()` returns `SQL_HINT`, and the sibling tokens `VALUE_MATCH` and `REGEX_MATCH` match their own names. ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc. Execute `ALTER DEFAULT SHADOW ALGORITHM TYPE(NAME=SQL_HINT)` against ShardingSphere-Proxy. ### Example codes for reproduce this issue (such as a github link). N/A -- 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]
