You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "iamhucong (via GitHub)" <gi...@apache.org> on 2026/08/11 01:41:28 UTC
[PR] Fix MySQL SHOW CREATE TABLE replacement for special characters [shardingsphere]
iamhucong opened a new pull request, #39403:
URL: https://github.com/apache/shardingsphere/pull/39403
Changes proposed in this pull request:
- Treat actual and logic table names as literal values when rewriting MySQL `SHOW CREATE TABLE` output.
- Cover dollar signs in both sharding and binding table names with a regression test.
MySQL permits `$` in unquoted identifiers, but `String.replaceFirst` interprets its first argument as a regular expression and its second argument as a replacement template. Quoting both values preserves the existing first-occurrence behavior without treating valid identifier characters as regex syntax.
Verification:
- `./mvnw -pl features/sharding/dialect/mysql -DskipITs test`
- `./mvnw checkstyle:check -Pcheck -T1C`
- `./mvnw spotless:apply -Pcheck -T1C`
Documentation and release notes are not changed because this restores existing `SHOW CREATE TABLE` behavior without changing configuration or public APIs.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MySQL SHOW CREATE TABLE replacement for special characters [shardingsphere]
Posted by "iamhucong (via GitHub)" <gi...@apache.org>.
iamhucong commented on PR #39403:
URL: https://github.com/apache/shardingsphere/pull/39403#issuecomment-5250461995
### Code Correctness Review
**Review Result: Mergeable**
The patch fixes the root cause while preserving first-occurrence replacement semantics. No blocking code-correctness issues were found.
Evidence:
- MySQL permits `$` in unquoted identifiers: [MySQL 8.4 Reference Manual ยง11.2](https://dev.mysql.com/doc/refman/8.4/en/identifiers.html).
- Both regex patterns and replacement values are quoted for sharding and binding table names.
- The regression test exercises both replacements with `$` and verifies the complete rewritten DDL.
- Focused tests (7), module tests (21), Spotless, and Checkstyle passed; target-class JaCoCo CLASS/LINE/BRANCH coverage is 100%.
Reviewed head: `a638bcef973867cc7dfd71ec537d6615aa54ca1b`. This is a code-scope review; CI was not reviewed.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Fix MySQL SHOW CREATE TABLE replacement for special characters [shardingsphere]
Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu merged PR #39403:
URL: https://github.com/apache/shardingsphere/pull/39403
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org