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 2021/09/27 03:47:26 UTC

[GitHub] [shardingsphere] strongduanmu opened a new issue #12763: Wrong routing result appeared when I adjusted the position of sharding condition

strongduanmu opened a new issue #12763:
URL: https://github.com/apache/shardingsphere/issues/12763


   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   
   master branch
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   
   ShardingSphere-Proxy
   
   ### Expected behavior
   
   Correct routing based on sharding conditions
   
   ```sql
   [INFO ] 2021-09-27 11:44:18.674 [Connection-1-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: SHOW COLUMNS FROM t_encrypt 
   [INFO ] 2021-09-27 11:44:23.290 [Connection-1-ThreadExecutor] ShardingSphere-SQL - Logic SQL: select * from t_order o inner join t_order_item i on o.order_id = i.order_id where 1 = o.order_id
   [INFO ] 2021-09-27 11:44:23.290 [Connection-1-ThreadExecutor] ShardingSphere-SQL - SQLStatement: MySQLSelectStatement(limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
   [INFO ] 2021-09-27 11:44:23.290 [Connection-1-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: select * from t_order_1 o inner join t_order_item_1 i on o.order_id = i.order_id where 1 = o.order_id
   [INFO ] 2021-09-27 11:44:23.290 [Connection-1-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: select * from t_order_1 o inner join t_order_item_1 i on o.order_id = i.order_id where 1 = o.order_id
   ```
   
   ### Actual behavior
   
   ```sql
   [INFO ] 2021-09-27 11:44:18.674 [Connection-1-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: SHOW COLUMNS FROM t_encrypt 
   [INFO ] 2021-09-27 11:44:23.290 [Connection-1-ThreadExecutor] ShardingSphere-SQL - Logic SQL: select * from t_order o inner join t_order_item i on o.order_id = i.order_id where o.order_id = 1
   [INFO ] 2021-09-27 11:44:23.290 [Connection-1-ThreadExecutor] ShardingSphere-SQL - SQLStatement: MySQLSelectStatement(limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
   [INFO ] 2021-09-27 11:44:23.290 [Connection-1-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_0 ::: select * from t_order_1 o inner join t_order_item_1 i on o.order_id = i.order_id where o.order_id = 1
   [INFO ] 2021-09-27 11:44:23.290 [Connection-1-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: select * from t_order_1 o inner join t_order_item_1 i on o.order_id = i.order_id where o.order_id = 1
   ```
   
   ### Reason analyze (If you can)
   
   When the extract method of ColumnExtractor processes BinaryOperationExpression, only leftColumn is considered, not rightColumn.
   
   ### 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).
   


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] tristaZero closed issue #12763: Wrong routing result appeared when I adjusted the position of sharding condition

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


   


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

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org