You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "sandynz (via GitHub)" <gi...@apache.org> on 2023/03/16 12:25:57 UTC

[GitHub] [shardingsphere] sandynz opened a new issue, #24655: Select from sub-query return records more than limited count on proxy

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

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


[GitHub] [shardingsphere] sandynz commented on issue #24655: Select from sub-query return records more than limited count on proxy

Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz commented on issue #24655:
URL: https://github.com/apache/shardingsphere/issues/24655#issuecomment-1473000104

   Set `sql-federation-type: ADVANCED` in `server.yaml` to support it.
   
   ```
   mysql> select * from (select order_id,user_id from t_order order by order_id desc limit 1) t;
   +----------+---------+
   | order_id | user_id |
   +----------+---------+
   |    10000 |       1 |
   +----------+---------+
   1 row in set (0.38 sec)
   
   mysql> select order_id,user_id from t_order order by order_id desc limit 1;
   +----------+---------+
   | order_id | user_id |
   +----------+---------+
   |    10000 |       1 |
   +----------+---------+
   1 row in set (0.04 sec)
   ```
   


-- 
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] sandynz closed issue #24655: Select from sub-query return records more than limited count on proxy

Posted by "sandynz (via GitHub)" <gi...@apache.org>.
sandynz closed issue #24655: Select from sub-query return records more than limited count on proxy
URL: https://github.com/apache/shardingsphere/issues/24655


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