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 2022/10/10 06:40:58 UTC

[GitHub] [shardingsphere] Gordonman opened a new issue, #17117: There is a problem parsing union SQL for same table

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: notifications-unsubscribe@shardingsphere.apache.org.apache.org

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


[GitHub] [shardingsphere] strongduanmu commented on issue #17117: There is a problem parsing union SQL for same table

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

   Hi @Gordonman, can you try the latest version? 4.0.0 is too old.


-- 
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] Gordonman commented on issue #17117: There is a problem parsing union SQL for same table

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

   > 
   
   Which version supports this feature?


-- 
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] github-actions[bot] closed issue #17117: There is a problem parsing union SQL for same table

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #17117: There is a problem parsing union SQL for same table
URL: https://github.com/apache/shardingsphere/issues/17117


-- 
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] RaigorJiang closed issue #17117: There is a problem parsing union SQL for same table

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang closed issue #17117: There is a problem parsing union SQL for same table
URL: https://github.com/apache/shardingsphere/issues/17117


-- 
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] strongduanmu commented on issue #17117: There is a problem parsing union SQL for same table

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

   > > 
   > 
   > Hi @strongduanmu Which version supports this feature?
   
   You can try 5.1.1, for more detailed info, refer to this doc——https://shardingsphere.apache.org/document/current/cn/features/sharding/use-norms/sql/#sql-%E7%A4%BA%E4%BE%8B.


-- 
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] github-actions[bot] commented on issue #17117: There is a problem parsing union SQL for same table

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #17117:
URL: https://github.com/apache/shardingsphere/issues/17117#issuecomment-1272349908

   Hello , this issue has not received a reply for several days.
   This issue is supposed to be closed.


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