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 2022/07/13 12:31:14 UTC
[GitHub] [shardingsphere] strongduanmu opened a new issue, #19113: Resources do not exist in database exception occur when execute create sharding table rule without $
strongduanmu opened a new issue, #19113:
URL: https://github.com/apache/shardingsphere/issues/19113
## Bug Report
### Which version of ShardingSphere did you use?
https://github.com/apache/shardingsphere/commit/2aa03356b75cd4cf1dec2f114e5e03ffb95108ec
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy
### Expected behavior
Execute following distsql successfully.
```sql
CREATE SHARDING TABLE RULE ASW_DEPS (
DATANODES("rts_stock_wtcth_readwrite_ds.ASW_DEPS,rts_stock_wtcmy_readwrite_ds.ASW_DEPS"),
DATABASE_STRATEGY(TYPE=standard,SHARDING_COLUMN=BU_CODE,SHARDING_ALGORITHM(TYPE(NAME=RTS_STOCK_DATABASE)))
);
```
### Actual behavior
```
mysql> USE RTS_STOCK;
mysql> CREATE SHARDING TABLE RULE ASW_DEPS (
-> DATANODES("rts_stock_wtcth_readwrite_ds.ASW_DEPS,rts_stock_wtcmy_readwrite_ds.ASW_DEPS"),
-> DATABASE_STRATEGY(TYPE=standard,SHARDING_COLUMN=BU_CODE,SHARDING_ALGORITHM(TYPE(NAME=RTS_STOCK_DATABASE)))
-> );
ERROR 1102 (C1102): Resources [rts_stock_wtcth_readwrite_ds.ASW_DEPS,rts_stock_wtcmy_readwrite_ds.ASW_DEPS] do not exist in database RTS_STOCK.
```
### Reason analyze (If you can)
Wrong judge logic in ShardingTableRuleStatementChecker class.
```java
private static Collection<String> parseDateSource(final String dateSource) {
return InlineExpressionParser.isInlineExpression(dateSource) ? new InlineExpressionParser(dateSource).splitAndEvaluate() : Collections.singletonList(dateSource);
}
```
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
### Example codes for reproduce this issue (such as a github link).
--
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
[GitHub] [shardingsphere] strongduanmu closed issue #19113: Resources do not exist in database exception occur when execute create sharding table rule without $
Posted by GitBox <gi...@apache.org>.
strongduanmu closed issue #19113: Resources do not exist in database exception occur when execute create sharding table rule without $
URL: https://github.com/apache/shardingsphere/issues/19113
--
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