Bug Report
Which version of ShardingSphere did you use?
master @ 6621687
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
Both
Expected behavior
Broadcast table names are matched case-insensitively (core BroadcastRule.tables is a CaseInsensitiveSet). Creating a broadcast rule for T_ORDER when t_order exists should raise DuplicateRuleException, and dropping T_ORDER should remove t_order.
Actual behavior
The DistSQL create and drop executors compare table names case-sensitively:
- CREATE: the duplicate check misses
T_ORDER vs t_order, no DuplicateRuleException is thrown, and both cases get stored.
- DROP: the existence check (case-insensitive) passes, but
hasAnyOneToBeDropped (case-sensitive) reports nothing to drop, a silent no-op.
Reason analyze (If you can)
CreateBroadcastTableRuleExecutor.getDuplicatedRuleNames() copies rule tables into a case-sensitive HashSet before retainAll. DropBroadcastTableRuleExecutor.hasAnyOneToBeDropped() runs Collections.disjoint on the raw case-sensitive collection. Its own existence check and the sibling DropMaskRuleExecutor already wrap current tables in CaseInsensitiveSet (drop path partially fixed in #30180).
Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
CREATE BROADCAST TABLE RULE t_order;
CREATE BROADCAST TABLE RULE T_ORDER;
DROP BROADCAST TABLE RULE T_ORDER;
Example codes for reproduce this issue (such as a github link).
N/A
Bug Report
Which version of ShardingSphere did you use?
master @ 6621687
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
Both
Expected behavior
Broadcast table names are matched case-insensitively (core
BroadcastRule.tablesis aCaseInsensitiveSet). Creating a broadcast rule forT_ORDERwhent_orderexists should raiseDuplicateRuleException, and droppingT_ORDERshould removet_order.Actual behavior
The DistSQL create and drop executors compare table names case-sensitively:
T_ORDERvst_order, noDuplicateRuleExceptionis thrown, and both cases get stored.hasAnyOneToBeDropped(case-sensitive) reports nothing to drop, a silent no-op.Reason analyze (If you can)
CreateBroadcastTableRuleExecutor.getDuplicatedRuleNames()copies rule tables into a case-sensitiveHashSetbeforeretainAll.DropBroadcastTableRuleExecutor.hasAnyOneToBeDropped()runsCollections.disjointon the raw case-sensitive collection. Its own existence check and the siblingDropMaskRuleExecutoralready wrap current tables inCaseInsensitiveSet(drop path partially fixed in #30180).Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
CREATE BROADCAST TABLE RULE t_order;CREATE BROADCAST TABLE RULE T_ORDER;DROP BROADCAST TABLE RULE T_ORDER;Example codes for reproduce this issue (such as a github link).
N/A