[MDEV-30139] The select query result does not meet expectations Created: 2022-12-01  Updated: 2023-11-28

Status: Confirmed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.5.16, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9
Fix Version/s: 10.4, 10.5, 10.6

Type: Bug Priority: Major
Reporter: dongjian Assignee: Oleksandr Byelkin
Resolution: Unresolved Votes: 0
Labels: None

Attachments: PNG File screenshot-1.png    

 Description   

expect consistent results

MariaDB [mydb]> select b.a as x, b.a as y from (select database() as a from t1) as b group by 2;
+------+------+
| y    | y    |
+------+------+
| mydb | mydb |
+------+------+
1 row in set (0.001 sec)
 
MariaDB [mydb]> select b.a as x, b.a as y from (select database() as a from t1) as b;
+------+------+
| x    | y    |
+------+------+
| mydb | mydb |
+------+------+
1 row in set (0.001 sec)



 Comments   
Comment by Alice Sherepa [ 2022-12-01 ]

Thank you! I repeated on 10.3-10.10

MariaDB [test]> select a as x, a  from (select now() as a from t1) dt group by 1;
+---------------------+---------------------+
| a                   | a                   |
+---------------------+---------------------+
| 2022-12-01 13:37:50 | 2022-12-01 13:37:50 |
+---------------------+---------------------+
1 row in set (0,001 sec)

Generated at Thu Feb 08 10:13:57 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.