strongduanmu opened a new issue, #25987: URL: https://github.com/apache/shardingsphere/issues/25987
## Bug Report ### Which version of ShardingSphere did you use? [492ba45](https://github.com/apache/shardingsphere/commit/492ba45118137b3a835de3e455a606b571653034) ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy? ShardingSphere-Proxy ### Expected behavior When I exeucte following sql, it can rewrite correctly. ``` [INFO ] 2023-06-01 15:55:01.701 [Connection-1-ThreadExecutor] ShardingSphere-SQL - Logic SQL: SELECT * FROM ( SELECT * FROM t_encrypt e ) AS temp WHERE user_id = "123" [INFO ] 2023-06-01 15:55:01.701 [Connection-1-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: SELECT temp.`id`, temp.`user_cipher` AS `user_id`, temp.`order_encrypt` AS `order_id` FROM ( SELECT e.`id`, e.`user_cipher`, e.`order_encrypt` FROM t_encrypt e ) AS temp WHERE user_cipher = 'DZEHT99l6UjthceKuCCKIw==' ``` ### Actual behavior ``` [INFO ] 2023-06-01 15:54:25.794 [Connection-1-ThreadExecutor] ShardingSphere-SQL - Logic SQL: SELECT * FROM ( SELECT * FROM t_encrypt e ) AS temp WHERE user_id = "123" [INFO ] 2023-06-01 15:54:25.794 [Connection-1-ThreadExecutor] ShardingSphere-SQL - Actual SQL: ds_1 ::: SELECT `temp`.`id`, `temp`.`user_cipher` AS `user_id`, `temp`.`order_encrypt` AS `order_id` FROM ( SELECT e.`id`, e.`user_cipher`, e.`order_encrypt` FROM t_encrypt e ) AS temp WHERE user_cipher = 'DZEHT99l6UjthceKuCCKIw==' ``` ### Reason analyze (If you can) ### 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]
