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/08/26 15:21:55 UTC

[GitHub] [shardingsphere] fantacy2001 opened a new issue #7091: sharding jdbc the sql of select DISTINCT in version 4.0.0 is support but in version 4.1.1 is not support

fantacy2001 opened a new issue #7091:
URL: https://github.com/apache/shardingsphere/issues/7091


   sql:
   select count(1) count from (select DISTINCT
           header.id,
           header.uuid,
           header.machining_no,
           header.machining_type,
           header.tenant_id,
           header.warehouse_no,
           header. STATUS,
           header.create_user,
           header.update_user,
           header.create_time,
           header.update_time,
           header.is_delete,
           header.memo,
           header.oper_location_no,
           header.fail_reason,
           header.order_origin,
           header.end_time
           from machining_header header
           LEFT JOIN machining_src_detail src ON src.machining_no = header.machining_no
           AND src.tenant_id = header.tenant_id
           AND src.warehouse_no = header.warehouse_no
           LEFT JOIN machining_dest_detail dest ON dest.machining_no = header.machining_no
           AND dest.tenant_id = header.tenant_id
           AND dest.warehouse_no = header.warehouse_no
           where
           header.is_delete=0      
               and header.machining_no = 'MA18012110000001'         
           and header.tenant_id = 'aa'        
               and header.warehouse_no = '26' ) t
   
   use version 4.0.0, it can route to right db, but use 4.1.1, it  route to wrong db
   mybatis + spring 


----------------------------------------------------------------
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] jingshanglu commented on issue #7091: sharding jdbc the sql of select DISTINCT in version 4.0.0 is support but in version 4.1.1 is not support

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


   @kimmking @fantacy2001 Now, it has been fixed on master branch, new version will be ok.


----------------------------------------------------------------
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] kimmking commented on issue #7091: sharding jdbc the sql of select DISTINCT in version 4.0.0 is support but in version 4.1.1 is not support

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


   Hi, can you show the original SQL


----------------------------------------------------------------
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] fantacy2001 edited a comment on issue #7091: sharding jdbc the sql of select DISTINCT in version 4.0.0 is support but in version 4.1.1 is not support

Posted by GitBox <gi...@apache.org>.
fantacy2001 edited a comment on issue #7091:
URL: https://github.com/apache/shardingsphere/issues/7091#issuecomment-681301174


   > can you show your configuration and actual sql?
   
   version 4.1.1,  When routing, the PreciseShardingAlgorithm do not called, so route to default db. 
   The actual SQL is what I sent above。
   Because I redefined sharding's access with Java, the configuration file is different from the official one。
   It is divided into two libraries, each of which has one master and two slaves。
   sharding field: tenant_id 
   KeyGenerator is baidu UID
   bindingTables is machining_src_detail 、machining_dest_detail 
   the customize sharding Algorithm ,implements PreciseShardingAlgorithm 
   


----------------------------------------------------------------
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] kimmking closed issue #7091: sharding jdbc the sql of select DISTINCT in version 4.0.0 is support but in version 4.1.1 is not support

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


   


----------------------------------------------------------------
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] kimmking edited a comment on issue #7091: sharding jdbc the sql of select DISTINCT in version 4.0.0 is support but in version 4.1.1 is not support

Posted by GitBox <gi...@apache.org>.
kimmking edited a comment on issue #7091:
URL: https://github.com/apache/shardingsphere/issues/7091#issuecomment-681480667


   It's a bug. test is a logic table with id as sharding key.
   > select distinct id,name from test where id=1000
   > will be converted to 
   > select distinct id,name from test00 where id=1000
   
   but the subquery can't routing to sharidng table:
   > select count(1) from (select distinct id,name from test where id=1000)t;
   > will be converted to 
   > select count(1) from (select distinct id,name from test where id=1000)t;
   
   @jingshanglu 
   


----------------------------------------------------------------
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] kimmking closed issue #7091: sharding jdbc the sql of select DISTINCT in version 4.0.0 is support but in version 4.1.1 is not support

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


   


----------------------------------------------------------------
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] fantacy2001 commented on issue #7091: sharding jdbc the sql of select DISTINCT in version 4.0.0 is support but in version 4.1.1 is not support

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


   > can you show your configuration and actual sql?
   
   version 4.1.1,  When routing, the PreciseShardingAlgorithm do not called, so route to default db. 
   The actual SQL is what I sent above。
   Because I redefined sharding's access with Java, the configuration file is different from the official one。
   It is divided into two libraries, each of which has one master and two slaves。
   sharding field: tenant_id 
   KeyGenerator is baidu UID
   bindingTables is machining_src_detail 、machining_dest_detail 
   
   


----------------------------------------------------------------
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] kimmking commented on issue #7091: sharding jdbc the sql of select DISTINCT in version 4.0.0 is support but in version 4.1.1 is not support

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


   can you show your configuration and actual sql?


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