You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/05/21 08:33:28 UTC
[GitHub] [shardingsphere] menghaoranss opened a new issue #10421: Optimize check logic for CreateShardingTableRuleBackendHandler
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:
users@infra.apache.org
[GitHub] [shardingsphere] strongduanmu commented on issue #10421: Optimize check logic for CreateShardingTableRuleBackendHandler
Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #10421:
URL: https://github.com/apache/shardingsphere/issues/10421#issuecomment-846734499
@totalo Welcome, assigned.
--
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:
users@infra.apache.org
[GitHub] [shardingsphere] totalo commented on issue #10421: Optimize check logic for CreateShardingTableRuleBackendHandler
Posted by GitBox <gi...@apache.org>.
totalo commented on issue #10421:
URL: https://github.com/apache/shardingsphere/issues/10421#issuecomment-846735535
> @totalo Welcome, assigned.
Thank you very much!
--
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:
users@infra.apache.org
[GitHub] [shardingsphere] menghaoranss closed issue #10421: Optimize check logic for CreateShardingTableRuleBackendHandler
Posted by GitBox <gi...@apache.org>.
menghaoranss closed issue #10421:
URL: https://github.com/apache/shardingsphere/issues/10421
--
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:
users@infra.apache.org
[GitHub] [shardingsphere] totalo commented on issue #10421: Optimize check logic for CreateShardingTableRuleBackendHandler
Posted by GitBox <gi...@apache.org>.
totalo commented on issue #10421:
URL: https://github.com/apache/shardingsphere/issues/10421#issuecomment-846730589
Hi, can I try to solve this problem?
--
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:
users@infra.apache.org
[GitHub] [shardingsphere] menghaoranss commented on issue #10421: Optimize check logic for CreateShardingTableRuleBackendHandler
Posted by GitBox <gi...@apache.org>.
menghaoranss commented on issue #10421:
URL: https://github.com/apache/shardingsphere/issues/10421#issuecomment-847492737
@totalo merged! Maybe you can try to fix #10417
--
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:
users@infra.apache.org