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 2020/06/07 09:13:42 UTC

[GitHub] [shardingsphere] panyingself opened a new issue #5938: SQL executed by ShardingSphere cannot be mapped to a real physical table, database parsing takes effect, but table parsing does not

panyingself opened a new issue #5938:
URL: https://github.com/apache/shardingsphere/issues/5938


   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   
   <dependency>
                   <groupId>org.apache.shardingsphere</groupId>
                   <artifactId>sharding-jdbc-core</artifactId>
                   <version>4.0.0</version>
   </dependency>
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   
   ### Expected behavior
   
   Curd operations can be performed normally with DB and TABLE configurations
   
   ### Actual behavior
   ![image](https://user-images.githubusercontent.com/13727304/83964819-0f3db900-a8e2-11ea-93fe-8af684ae8d95.png)
   
   Hint: Table 'entity_storage_0.entity_detail' doesn't exist
   
   ### Reason analyze (If you can)
   
   ### 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).
   
   private DataSource buildDataSource() throws SQLException {
           //设置从库数据源集合
           Map<String, DataSource> dataSourceMap = Maps.newConcurrentMap();
           dataSourceMap.put("ds0", masterDbConfig.createDataSouce());
           dataSourceMap.put("ds1", slave0DataBaseConfig.createDataSouce());
   
   
           // 配置Order表规则 - 哪些库的哪些表参与规则,使用行表达式
           TableRuleConfiguration entityDetailTableRuleConfig = new TableRuleConfiguration("entity_detail_", "ds${0..1}.entity_detail_${0..1}");
   
           // 配置分库 + 分表策略
           entityDetailTableRuleConfig.setDatabaseShardingStrategyConfig(new InlineShardingStrategyConfiguration("entity_id", "ds${entity_id % 2}"));
   
           entityDetailTableRuleConfig.setTableShardingStrategyConfig(new InlineShardingStrategyConfiguration("entity_id", "entity_detail_${entity_id % 2}"));
   //        entityDetailTableRuleConfig.setKeyGeneratorConfig(getKeyGeneratorConfiguration());
   
           // 配置分片规则
           ShardingRuleConfiguration shardingRuleConfig = new ShardingRuleConfiguration();
           shardingRuleConfig.getTableRuleConfigs().add(entityDetailTableRuleConfig);
   
           // 获取数据源对象
           return ShardingDataSourceFactory.createDataSource(dataSourceMap, shardingRuleConfig, this.getProperties());
       }
   


----------------------------------------------------------------
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] panyingself commented on issue #5938: SQL executed by ShardingSphere cannot be mapped to a real physical table, database parsing takes effect, but table parsing does not

Posted by GitBox <gi...@apache.org>.
panyingself commented on issue #5938:
URL: https://github.com/apache/shardingsphere/issues/5938#issuecomment-640182443


   This is based on the configuration of the official document. According to the analysis of the results, there should be no successful parsing of the rules of the sub-table and no naming of the transformed table. But I don't know how to adjust it, please help me


----------------------------------------------------------------
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] panyingself commented on issue #5938: SQL executed by ShardingSphere cannot be mapped to a real physical table, database parsing takes effect, but table parsing does not

Posted by GitBox <gi...@apache.org>.
panyingself commented on issue #5938:
URL: https://github.com/apache/shardingsphere/issues/5938#issuecomment-640182587


   ![image](https://user-images.githubusercontent.com/13727304/83964908-85422000-a8e2-11ea-8f0c-f6fdbe889468.png)
   ![image](https://user-images.githubusercontent.com/13727304/83964913-8d01c480-a8e2-11ea-9fa0-d662191d5597.png)
   
   entity_id = 2


----------------------------------------------------------------
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] panyingself commented on issue #5938: SQL executed by ShardingSphere cannot be mapped to a real physical table, database parsing takes effect, but table parsing does not

Posted by GitBox <gi...@apache.org>.
panyingself commented on issue #5938:
URL: https://github.com/apache/shardingsphere/issues/5938#issuecomment-640188678


   This is the source address:
   
   https://github.com/panyingself/springboot-sharding-jdbc-mybatis/tree/master/sharding-jdbc-mybatis-sharding
   
   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] panyingself closed issue #5938: SQL executed by ShardingSphere cannot be mapped to a real physical table, database parsing takes effect, but table parsing does not

Posted by GitBox <gi...@apache.org>.
panyingself closed issue #5938:
URL: https://github.com/apache/shardingsphere/issues/5938


   


----------------------------------------------------------------
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] panyingself commented on issue #5938: SQL executed by ShardingSphere cannot be mapped to a real physical table, database parsing takes effect, but table parsing does not

Posted by GitBox <gi...@apache.org>.
panyingself commented on issue #5938:
URL: https://github.com/apache/shardingsphere/issues/5938#issuecomment-640202345


   Source solution has been viewed
   
   


----------------------------------------------------------------
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