Gordonman opened a new issue, #17117:
URL: https://github.com/apache/shardingsphere/issues/17117

   **ShardingSphere version:**  4.0.0-RC2
   
   **project:**  ShardingSphere-JDBC
   
   **Test case:**
   tableName:  coupon_detail
   sharding-column:  mer_code
   precise-algorithm:   Modulo Operation for mer_code.   ex:  mer_code=123456  
, actual-data-node= 123456 % 10 = 6  
   
   Origin sql: 
   ```
   SELECT *  FROM coupon_detail  WHERE  mer_code = '123456' AND user_card 
='AAA' 
   UNION
   SELECT *  FROM coupon_detail  WHERE mer_code = '123456' AND user_id =12345678
   ```
   
   Expected behavior:
   ```
   SELECT *  FROM coupon_detail_6  WHERE  mer_code = '123456' AND user_card 
='AAA' 
   UNION
   SELECT *  FROM coupon_detail_6  WHERE mer_code = '123456' AND user_id 
=12345678
   ```
   
   Actual behavior
   ```
   SELECT *  FROM coupon_detail_6  WHERE  mer_code = '123456' AND user_card 
='AAA' 
   UNION
   SELECT *  FROM coupon_detail  WHERE mer_code = '123456' AND user_id =12345678
   ```
   
   **The second table name is not rewrite.**
   
    
   **Reason analyze:**
   I tracked the source code and found SQLParseEngine only parse first table 
segment , So  SQLRewriteEngine only rewrite first table name.


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