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/01/06 01:33:16 UTC

[GitHub] [incubator-shardingsphere] HelloNanKe opened a new issue #3872: Must have sharding column with subquery.

HelloNanKe opened a new issue #3872: Must have sharding column with subquery.
URL: https://github.com/apache/incubator-shardingsphere/issues/3872
 
 
   I have a sql  like this 
   ```sql
   SELECT
   *
   FROM
   	change_record_detail AS record_detail
   	INNER JOIN (
   	SELECT
   		id AS id2 
   	FROM
   		change_record_detail 
   	WHERE
   		goods_id IN (?) 
   	ORDER BY
   		id DESC 
   	LIMIT ?,
   	?) AS page_detail ON record_detail.id = page_detail.id2
   ```
   sharding column is another field.
   It can be execute in navicat.
   In shardingsphere i got a exception
   ```java
   ### Cause: java.lang.IllegalStateException: Must have sharding column with subquery.
   	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:149)
   	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)
   	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   	at java.lang.reflect.Method.invoke(Method.java:498)
   	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426)
   	... 81 more
   
   ```

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

[GitHub] [incubator-shardingsphere] terrymanu closed issue #3872: Must have sharding column with subquery.

Posted by GitBox <gi...@apache.org>.
terrymanu closed issue #3872: Must have sharding column with subquery.
URL: https://github.com/apache/incubator-shardingsphere/issues/3872
 
 
   

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

[GitHub] [incubator-shardingsphere] terrymanu commented on issue #3872: Must have sharding column with subquery.

Posted by GitBox <gi...@apache.org>.
terrymanu commented on issue #3872: Must have sharding column with subquery.
URL: https://github.com/apache/incubator-shardingsphere/issues/3872#issuecomment-570985778
 
 
   Just like exception said: `Must have sharding column with subquery.`

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