You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "rishi-rana (via GitHub)" <gi...@apache.org> on 2026/08/31 02:14:40 UTC
[PR] Use case-insensitive table name matching in CREATE/ALTER MASK RULE executors [shardingsphere]
rishi-rana opened a new pull request, #39660:
URL: https://github.com/apache/shardingsphere/pull/39660
Fixes #39359.
Changes proposed in this pull request:
- `CreateMaskRuleExecutor.checkDuplicatedRuleNames()`: copy current table names into a `CaseInsensitiveSet` instead of `Collectors.toList()`, so `CREATE MASK RULE T_ORDER` over an existing `t_order` now raises `DuplicateRuleException` instead of storing a duplicate.
- `AlterMaskRuleExecutor.checkToBeAlteredRules()`: same fix, so `ALTER MASK RULE T_ORDER` no longer fails with `MissingRequiredRuleException` when only `t_order` exists.
- `AlterMaskRuleExecutor.buildToBeDroppedRuleConfiguration()`: same fix for the `toBeAlteredTableNames` comparison, so a case-differing ALTER no longer leaves the old table's algorithm incorrectly counted as still in use.
- Matches the existing `CaseInsensitiveSet` pattern already used in `DropMaskRuleExecutor` and applied to the sibling broadcast rule type in #39200.
- Added case-insensitive unit test coverage to both executor test classes.
This pull request was drafted with assistance from Claude Code (Anthropic). Affected scope: the three executor methods above and their corresponding unit tests in `CreateMaskRuleExecutorTest`/`AlterMaskRuleExecutorTest`. I reviewed and verified all changes myself.
---
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.
- [x] 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/)
--
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] Use case-insensitive table name matching in CREATE/ALTER MASK RULE executors [shardingsphere]
Posted by "rishi-rana (via GitHub)" <gi...@apache.org>.
rishi-rana commented on PR #39660:
URL: https://github.com/apache/shardingsphere/pull/39660#issuecomment-5576723533
Can I please get another review, thanks
--
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] Use case-insensitive table name matching in CREATE/ALTER MASK RULE executors [shardingsphere]
Posted by "rishi-rana (via GitHub)" <gi...@apache.org>.
rishi-rana commented on PR #39660:
URL: https://github.com/apache/shardingsphere/pull/39660#issuecomment-5503171688
Can I get review please
--
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] Use case-insensitive table name matching in CREATE/ALTER MASK RULE executors [shardingsphere]
Posted by "rishi-rana (via GitHub)" <gi...@apache.org>.
rishi-rana commented on PR #39660:
URL: https://github.com/apache/shardingsphere/pull/39660#issuecomment-5528842930
Thanks for the thorough review — both points fixed:
1. **Stale table entry on case-only ALTER**: added `findStaleCaseChangedTables()` to `AlterMaskRuleExecutor.buildToBeDroppedRuleConfiguration()`, which now returns the original-cased table entry for deletion when its persisted name differs in case from the altered name (using a `CaseInsensitiveMap` lookup), so it's removed via `removeRuleConfigurationItem()` after the new-cased entry is persisted. An identical-case alter (the common path) is left untouched — confirmed the existing `assertBuildToBeDroppedRuleConfiguration` test (same case throughout) still passes, so the persist-then-delete-newly-altered-entry regression I was worried about doesn't happen.
2. **Cleanup test didn't distinguish the fix**: reworked `assertBuildToBeDroppedRuleConfigurationWithCaseChangedTableName` (renamed) to use distinct old/new algorithm names, and it now asserts both the stale table (`t_order`) and its orphaned algorithm (`old_order_mask`) are selected for deletion. I verified this test fails against the pre-fix implementation (reverted the production file locally, confirmed `Expected: is <1> but: was <0>`, then restored the fix) before pushing.
Local `checkstyle:check -Pcheck` and targeted unit tests both pass. Let me know if there's anything else.
--
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] Use case-insensitive table name matching in CREATE/ALTER MASK RULE executors [shardingsphere]
Posted by "rishi-rana (via GitHub)" <gi...@apache.org>.
rishi-rana commented on PR #39660:
URL: https://github.com/apache/shardingsphere/pull/39660#issuecomment-5533998082
@terrymanu , resolved the review comments, please re-review
--
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] Use case-insensitive table name matching in CREATE/ALTER MASK RULE executors [shardingsphere]
Posted by "rishi-rana (via GitHub)" <gi...@apache.org>.
rishi-rana commented on PR #39660:
URL: https://github.com/apache/shardingsphere/pull/39660#issuecomment-5554536060
@terrymanu changes are ready for your review.
--
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] Use case-insensitive table name matching in CREATE/ALTER MASK RULE executors [shardingsphere]
Posted by "rishi-rana (via GitHub)" <gi...@apache.org>.
rishi-rana closed pull request #39660: Use case-insensitive table name matching in CREATE/ALTER MASK RULE executors
URL: https://github.com/apache/shardingsphere/pull/39660
--
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] Use case-insensitive table name matching in CREATE/ALTER MASK RULE executors [shardingsphere]
Posted by "rishi-rana (via GitHub)" <gi...@apache.org>.
rishi-rana commented on PR #39660:
URL: https://github.com/apache/shardingsphere/pull/39660#issuecomment-5588480482
Thanks for the review, I am going to close the merge request as looks like https://github.com/apache/shardingsphere/pull/39361 already addressed the issue that I was trying to fic, so closing this request
--
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