thswlsqls opened a new pull request, #39853:
URL: https://github.com/apache/shardingsphere/pull/39853
Fixes #39849.
Changes proposed in this pull request:
- `MySQLShardingShowIndexMergedResult.init()` applied
`IndexMetaDataUtils.findGeneratedLogicIndexName()` to every row, with an empty
candidate list for non-sharding tables, so a user-defined index such as
`uk_t_config` on the single table `t_config` was returned as `uk`.
- Move the recovery into the `shardingTable.isPresent()` branch as
`findLogicIndexName()`, so only sharding-table rows are recovered against the
logic table's index metadata; non-sharding rows keep their `Key_name`.
- This matches `IndexToken`, `ShardingMetaDataReviseEntry` and the sibling
`MySQLShardingShowCreateTableMergedResult`, which leave non-sharding index
names untouched (#31173), and keeps the candidate-based recovery of #38449 for
sharding rows.
- Rename `assertGetValueWithShortenedIndexName` to
`assertGetValueWithLegacyIndexName` and stub the sharding path it exercises;
add `assertGetValueWithNonShardingTable`, which fails on master (`uk`) and
passes with this change (`uk_t_config`).
- Verification: module-scoped `./mvnw install -pl
features/sharding/dialect/mysql -am` plus repository-wide `spotless:check`,
`checkstyle:check` and `apache-rat:check` with `-Pcheck`; the full `clean
install` was not run locally.
AI assistance: Claude Code was used to draft the change and its unit tests
in `features/sharding/dialect/mysql`; 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`. Ran the module-scoped equivalent
instead: `./mvnw install -pl features/sharding/dialect/mysql -am -B -T1C
-Dmaven.javadoc.skip -Dmaven.jacoco.skip -e` (BUILD SUCCESS) and
repository-wide `spotless:check`, `checkstyle:check`, `apache-rat:check` with
`-Pcheck`.
- [ ] I have made corresponding changes to the documentation. No
documentation describes this merge behavior; none needed.
- [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]