menghaoranss opened a new issue #10421:
URL: https://github.com/apache/shardingsphere/issues/10421
refer #9964
Execute `RDL` `CREATE SHARDING TABLE RULE t_order(...),t_order_item(...)`,
the handler must check the tables `t_order` and `t_order_item` don't exist in
current schema, now the logic of get all tables in current schema as follows:
```
private Collection<String> getLogicTables(final String schemaName) {
Optional<ShardingRuleConfiguration> shardingRuleConfiguration =
getShardingRuleConfiguration(schemaName);
Collection<String> result = new LinkedList<>();
if (!shardingRuleConfiguration.isPresent()) {
return result;
}
result.addAll(shardingRuleConfiguration.get().getTables().stream().map(ShardingTableRuleConfiguration::getLogicTable).collect(Collectors.toList()));
result.addAll(shardingRuleConfiguration.get().getAutoTables().stream().map(ShardingAutoTableRuleConfiguration::getLogicTable).collect(Collectors.toList()));
return result;
}
```
1. This code should be instead of
`ProxyContext.getInstance().getMetaData(schemaName).getSchema().getAllTableNames();`
2. Refactor unit test in `CreateShardingTableRuleBackendHandlerTest.java`
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]