You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/02/15 08:06:54 UTC

[GitHub] JeddyHj opened a new issue #1868: Support sub-query Sql

JeddyHj opened a new issue #1868: Support sub-query Sql
URL: https://github.com/apache/incubator-shardingsphere/issues/1868
 
 
   Routing to single data node MySQL in documents is 100% supported, but I found that sub-query reported errors in actual test usage.
   
   SQL is as follows:
   SELECT COUNT(*) FROM (SELECT * FROM chat_status WHERE id = '123' ) o
   
   Errors were reported as follows:
   Caused by: java.lang.IllegalStateException: Must have sharding column with subquery.
   At com. google. common. base. Preconditions. checkState (Preconditions. java: 173)
   At io. shardingsphere. core. routing. router. sharding. ParsingSQLRouter. mergeShardingValue For SubQuery (ParsingSQLRouter. java: 154)
   At io. shardingsphere. core. routing. router. sharding. ParsingSQLRouter. route (ParsingSQLRouter. java: 100)
   At io. shardingsphere. core. routing. PreparedStatement Routing Engine. route (PreparedStatement Routing Engine. java: 64)
   At io. shardingsphere. shardingjdbc. jdbc. core. statement. ShardingPreparedStatement. sqlRoute (ShardingPreparedStatement. java: 214)
   Shardingsphere. shardingjdbc. jdbc. core. statement. ShardingPreparedStatement. executeQuery (ShardingPreparedStatement. java: 106)
   At im.qingtui.db.route.test.Test. <init> (Test.java:29)
   At sun. reflect. Native Constructor Accessor Impl. new Instance 0 (Native Method)
   At sun. reflect. Native Constructor Accessor Impl. new Instance (Native Constructor Accessor Impl. java: 62)
   At sun. reflect. Delegating Constructor Accessor Impl. new Instance (Delegating Constructor Accessor Impl. java: 45)
   At java.lang.reflect.Constructor.newInstance (Constructor.java:423)
   At org. spring framework. beans. BeanUtils. instantiateClass (BeanUtils. java: 142)
   ... 18 more

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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