You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "thswlsqls (via GitHub)" <gi...@apache.org> on 2026/08/06 23:07:59 UTC
[I] CREATE and ALTER MASK RULE match table names case-sensitively while DROP and SHOW do not [shardingsphere]
thswlsqls opened a new issue, #39359:
URL: https://github.com/apache/shardingsphere/issues/39359
## Bug Report
### Which version of ShardingSphere did you use?
master @ ba53784e172
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
Both
### Expected behavior
`CREATE`/`ALTER MASK RULE` match existing table names case-insensitively, as `DROP` and `SHOW` already do.
### Actual behavior
Given an existing `t_order` rule:
- `CREATE MASK RULE T_ORDER(...)` persists a duplicate table node instead of raising `DuplicateRuleException`, while `MaskRule.tables` (`CaseInsensitiveMap`) keeps one.
- `ALTER MASK RULE T_ORDER(...)` fails with `MissingRequiredRuleException`.
### Reason analyze (If you can)
`CreateMaskRuleExecutor.checkDuplicatedRuleNames()` (line 62), `AlterMaskRuleExecutor.checkToBeAlteredRules()` (line 58) and `AlterMaskRuleExecutor.buildToBeDroppedRuleConfiguration()` (line 74) collect table names with `Collectors.toList()`, so `contains` is case-sensitive; `DropMaskRuleExecutor` (lines 61, 69) already uses `CaseInsensitiveSet`. Line 74 additionally leaves the altered table's stale algorithm counted as in use.
#32755 made only Show and Drop case-insensitive; on #31727 a committer noted "Other feature types also need to be checked or adjusted". #39200 did this for broadcast.
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
```sql
CREATE MASK RULE t_order (COLUMNS((NAME=order_id, TYPE(NAME='MD5'))));
ALTER MASK RULE T_ORDER (COLUMNS((NAME=order_id, TYPE(NAME='SM3'))));
CREATE MASK RULE T_ORDER (COLUMNS((NAME=order_id, TYPE(NAME='MD5'))));
```
### 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: notifications-unsubscribe@shardingsphere.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] CREATE and ALTER MASK RULE match table names case-sensitively while DROP and SHOW do not [shardingsphere]
Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu closed issue #39359: CREATE and ALTER MASK RULE match table names case-sensitively while DROP and SHOW do not
URL: https://github.com/apache/shardingsphere/issues/39359
--
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: [I] CREATE and ALTER MASK RULE match table names case-sensitively while DROP and SHOW do not [shardingsphere]
Posted by "rishi-rana (via GitHub)" <gi...@apache.org>.
rishi-rana commented on issue #39359:
URL: https://github.com/apache/shardingsphere/issues/39359#issuecomment-5472841213
I'd like to work on this issue — I'll have a PR up within the next few days.
--
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