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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to