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

   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   master branch
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   Proxy
   
   ### Expected behavior
   Return rows as limited count
   
   ### Actual behavior
   
   In proxy:
   ```
   mysql> select * from (select order_id,user_id from t_order limit 1) t;
   +----------+---------+
   | order_id | user_id |
   +----------+---------+
   |      337 |       0 |
   |       54 |       3 |
   |       90 |       1 |
   |      166 |       4 |
   |       80 |       2 |
   |       14 |       5 |
   +----------+---------+
   6 rows in set (0.02 sec)
   
   mysql> select order_id,user_id from t_order limit 1;
   +----------+---------+
   | order_id | user_id |
   +----------+---------+
   |      337 |       0 |
   +----------+---------+
   1 row in set (0.01 sec)
   
   mysql> show sharding table nodes t_order;
   
+---------+------------------------------------------------------------------------------------------------+
   | name    | nodes                                                            
                              |
   
+---------+------------------------------------------------------------------------------------------------+
   | t_order | ds_2.t_order_0, ds_3.t_order_1, ds_4.t_order_2, ds_2.t_order_3, 
ds_3.t_order_4, ds_4.t_order_5 |
   
+---------+------------------------------------------------------------------------------------------------+
   1 row in set (0.07 sec)
   ```
   
   Actual SQL:
   ```
   [INFO ] 2023-03-16 20:18:04.467 [ShardingSphere-Command-14] 
ShardingSphere-SQL - Logic SQL: select * from (select order_id,user_id from 
t_order limit 1) t
   [INFO ] 2023-03-16 20:18:04.467 [ShardingSphere-Command-14] 
ShardingSphere-SQL - Actual SQL: ds_2 ::: select `t`.`order_id`, `t`.`user_id` 
from (select order_id,user_id from t_order_0 limit 1) t
   [INFO ] 2023-03-16 20:18:04.467 [ShardingSphere-Command-14] 
ShardingSphere-SQL - Actual SQL: ds_2 ::: select `t`.`order_id`, `t`.`user_id` 
from (select order_id,user_id from t_order_3 limit 1) t
   [INFO ] 2023-03-16 20:18:04.467 [ShardingSphere-Command-14] 
ShardingSphere-SQL - Actual SQL: ds_3 ::: select `t`.`order_id`, `t`.`user_id` 
from (select order_id,user_id from t_order_1 limit 1) t
   [INFO ] 2023-03-16 20:18:04.467 [ShardingSphere-Command-14] 
ShardingSphere-SQL - Actual SQL: ds_3 ::: select `t`.`order_id`, `t`.`user_id` 
from (select order_id,user_id from t_order_4 limit 1) t
   [INFO ] 2023-03-16 20:18:04.467 [ShardingSphere-Command-14] 
ShardingSphere-SQL - Actual SQL: ds_4 ::: select `t`.`order_id`, `t`.`user_id` 
from (select order_id,user_id from t_order_2 limit 1) t
   [INFO ] 2023-03-16 20:18:04.467 [ShardingSphere-Command-14] 
ShardingSphere-SQL - Actual SQL: ds_4 ::: select `t`.`order_id`, `t`.`user_id` 
from (select order_id,user_id from t_order_5 limit 1) t
   ```
   
   ### 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]

Reply via email to