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 2019/12/07 06:23:35 UTC

[GitHub] [incubator-shardingsphere] thinkwithlinc opened a new issue #3680: no table route info error when update to 4.0.0-RC3 from 4.0.0-RC2, TableRuleConfiguration#actualDataNodes not config

thinkwithlinc opened a new issue #3680: no table route info error when update to 4.0.0-RC3 from 4.0.0-RC2, TableRuleConfiguration#actualDataNodes not config
URL: https://github.com/apache/incubator-shardingsphere/issues/3680
 
 
   ## Question
   
   **For English only**, other languages will not accept.
   
   Before asking a question, make sure you have:
   
   - Googled your question.
   - Searched open and closed [GitHub issues](https://github.com/apache/incubator-shardingsphere/issues).
   - Read documentation: [ShardingSphere Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   ### Which version of ShardingSphere did you use?
   4.0.0-RC3
   
   ### Which project did you use? Sharding-JDBC or Sharding-Proxy?
   Sharding-JDBC
   
   ### Expected behavior
   query or insert correct
   
   ### Actual behavior
   Error querying database.  Cause: java.lang.IllegalStateException: no table route info
   
   ### Reason analyze (If you can)
   **i just set the logicTable in TableRuleConfiguration
   actualDataNodes is empty
   but 4.0.0-RC2 version is ok**
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   **config:**
               TableRuleConfiguration orderTableRuleConfig = new TableRuleConfiguration("t_order");
               orderTableRuleConfig.setTableShardingStrategyConfig(new InlineShardingStrategyConfiguration("order_type_id", "t_order_${order_type_id}"));
   
   **SQL:** 
   SELECT * FROM t_order WHERE (order_type_id in( '10001','10002','10003','10001') AND create_time >= '2019-12-01') ORDER BY create_time desc limit 2
   
   **error:**
   ### Error querying database.  Cause: java.lang.IllegalStateException: no table route info
   ### The error may exist in 
   xxxMapper.java (best guess)
   ### The error may involve defaultParameterMap
   ### The error occurred while setting parameters
   ### SQL: SELECT * FROM t_order WHERE (order_type_id in( '10001','10002','10003','10001') AND create_time >= '2019-12-01') ORDER BY create_time desc limit 2
   ### Cause: java.lang.IllegalStateException: no table route info
   	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26)
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:111)
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:102)
   	at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:119)
   	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63)
   	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52)
   	at com.sun.proxy.$Proxy31.queryTest(Unknown Source)
   	... 56 more
   Caused by: java.lang.IllegalStateException: no table route info
   	at com.google.common.base.Preconditions.checkState(Preconditions.java:173)
   	at org.apache.shardingsphere.core.route.type.standard.StandardRoutingEngine.routeTables(StandardRoutingEngine.java:211)
   	at org.apache.shardingsphere.core.route.type.standard.StandardRoutingEngine.route0(StandardRoutingEngine.java:191)
   	at org.apache.shardingsphere.core.route.type.standard.StandardRoutingEngine.routeByShardingConditionsWithCondition(StandardRoutingEngine.java:118)
   	at org.apache.shardingsphere.core.route.type.standard.StandardRoutingEngine.routeByShardingConditions(StandardRoutingEngine.java:112)
   	at org.apache.shardingsphere.core.route.type.standard.StandardRoutingEngine.getDataNodes(StandardRoutingEngine.java:97)
   	at org.apache.shardingsphere.core.route.type.standard.StandardRoutingEngine.route(StandardRoutingEngine.java:75)
   	at org.apache.shardingsphere.core.route.router.sharding.ShardingRouter.route(ShardingRouter.java:107)
   	at org.apache.shardingsphere.core.route.PreparedStatementRoutingEngine.route(PreparedStatementRoutingEngine.java:63)
   	at org.apache.shardingsphere.core.PreparedQueryShardingEngine.route(PreparedQueryShardingEngine.java:59)
   	at org.apache.shardingsphere.core.BaseShardingEngine.executeRoute(BaseShardingEngine.java:91)
   	at org.apache.shardingsphere.core.BaseShardingEngine.shard(BaseShardingEngine.java:74)
   	at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.shard(ShardingPreparedStatement.java:222)
   	at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.execute(ShardingPreparedStatement.java:163)
   org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:59)
   	at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:73)
   	at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:60)
   	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:267)
   	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:137)
   	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:96)
   	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:77)
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:108)
   	... 61 more
   
   ### 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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services