Description:
Result set of select BIN(id),1,id from t1 order by 1,2 desc does not incorrect.
----------------------------------------------------------------------------------
mysql> \s
--------------
/home/mjxue/install/mysql/sql/bin/mysql Ver 8.0.31 for Linux on x86_64 (Source distribution)
Connection id: 9
Current database:
Current user: root@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 8.0.31-debug Source distribution
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: utf8mb4
Db characterset: utf8mb4
Client characterset: utf8mb4
Conn. characterset: utf8mb4
UNIX socket: /home/mjxue/install/mysql/data/mysql.sock
Binary data as: Hexadecimal
Uptime: 1 min 12 sec
Threads: 2 Questions: 8 Slow queries: 0 Opens: 345 Flush tables: 3 Open tables: 37 Queries per second avg: 0.111
--------------
mysql> create database test;
Query OK, 1 row affected (0.01 sec)
mysql> use test;
Database changed
mysql> create table t1 (id bigint);
Query OK, 0 rows affected (0.06 sec)
mysql> insert into t1 values(177151194), (177151195);
Query OK, 2 rows affected (0.02 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> select BIN(id),1,id from t1 order by 1,2 desc;
+------------------------------+---+-----------+
| BIN(id) | 1 | id |
+------------------------------+---+-----------+
| 1010100011110001110011011010 | 1 | 177151194 |
| 1010100011110001110011011011 | 1 | 177151195 |
+------------------------------+---+-----------+
2 rows in set (0.00 sec)
The results in the first column are not output in descending order.
How to repeat:
As description.
Suggested fix:
No.