FlyingZC commented on issue #18207:
URL: 
https://github.com/apache/shardingsphere/issues/18207#issuecomment-1171995371

   I can't reproduce the two errors, the two sql can be executed correctly in 
my test case.
   
   ## count
   [INFO ] 2022-07-01 13:40:54.879 [Connection-1-ThreadExecutor] 
ShardingSphere-SQL - Logic SQL: select count(order_id) from t_order
   [INFO ] 2022-07-01 13:40:54.879 [Connection-1-ThreadExecutor] 
ShardingSphere-SQL - SQLStatement: MySQLSelectStatement(table=Optional.empty, 
limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
   [INFO ] 2022-07-01 13:40:54.879 [Connection-1-ThreadExecutor] 
ShardingSphere-SQL - Actual SQL: ds_0 ::: select count(order_id) from t_order_0 
UNION ALL select count(order_id) from t_order_1
   [INFO ] 2022-07-01 13:40:54.879 [Connection-1-ThreadExecutor] 
ShardingSphere-SQL - Actual SQL: ds_1 ::: select count(order_id) from t_order_0 
UNION ALL select count(order_id) from t_order_1
   
   <img width="322" alt="image" 
src="https://user-images.githubusercontent.com/19788130/176831280-d0719506-3dba-4541-92d1-9945f243bb34.png";>
   
   ## group by and order by
   [INFO ] 2022-07-01 14:38:54.684 [Connection-1-ThreadExecutor] 
ShardingSphere-SQL - Logic SQL: select * from t_order group by t_order.order_id 
order by t_order.status
   [INFO ] 2022-07-01 14:38:54.684 [Connection-1-ThreadExecutor] 
ShardingSphere-SQL - SQLStatement: MySQLSelectStatement(table=Optional.empty, 
limit=Optional.empty, lock=Optional.empty, window=Optional.empty)
   [INFO ] 2022-07-01 14:38:54.684 [Connection-1-ThreadExecutor] 
ShardingSphere-SQL - Actual SQL: ds_0 ::: select * from t_order_0 group by 
t_order_0.order_id order by t_order_0.status
   [INFO ] 2022-07-01 14:38:54.684 [Connection-1-ThreadExecutor] 
ShardingSphere-SQL - Actual SQL: ds_0 ::: select * from t_order_1 group by 
t_order_1.order_id order by t_order_1.status
   [INFO ] 2022-07-01 14:38:54.684 [Connection-1-ThreadExecutor] 
ShardingSphere-SQL - Actual SQL: ds_1 ::: select * from t_order_0 group by 
t_order_0.order_id order by t_order_0.status
   [INFO ] 2022-07-01 14:38:54.684 [Connection-1-ThreadExecutor] 
ShardingSphere-SQL - Actual SQL: ds_1 ::: select * from t_order_1 group by 
t_order_1.order_id order by t_order_1.status
   
   ```
   mysql> select * from t_order group by t_order.order_id order by 
t_order.status;
   +----------+---------+--------+
   | order_id | user_id | status |
   +----------+---------+--------+
   |        1 |       1 | 1      |
   |       11 |      11 | 11     |
   |       12 |      12 | 12     |
   |       13 |      13 | 13     |
   |       14 |      14 | 14     |
   |       15 |      15 | 15     |
   |       16 |      16 | 16     |
   |        2 |       2 | 2      |
   |        3 |       3 | 3      |
   |        4 |       4 | 4      |
   |        5 |       5 | 5      |
   |        6 |       6 | 6      |
   +----------+---------+--------+
   12 rows in set (0.02 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to