Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

query gets wrong result, related to order and information_schema table #31994

Closed
wjhuang2016 opened this issue Jan 26, 2022 · 3 comments
Closed
Labels
severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug. wontfix This issue will not be fixed.

Comments

@wjhuang2016
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

mysql> SELECT character_set_name, id, sortlen FROM information_schema.collations ORDER BY collation_name, id;
+--------------------+------+---------+
| character_set_name | id   | sortlen |
+--------------------+------+---------+
| ascii              |   65 |       1 |
| binary             |   63 |       1 |
| gbk                |   87 |       1 |
| gbk                |   28 |       1 |
| latin1             |   47 |       1 |
| utf8               |   83 |       1 |
| utf8               |   33 |       1 |
| utf8               |  192 |       1 |
| utf8mb4            |   46 |       1 |
| utf8mb4            |   45 |       1 |
| utf8mb4            |  224 |       1 |
+--------------------+------+---------+
11 rows in set (0.00 sec)

2. What did you expect to see? (Required)

Order by id

3. What did you see instead (Required)

Wrong

4. What is your TiDB version? (Required)

master

@Defined2014
Copy link
Contributor

Defined2014 commented Jan 27, 2022

The behavior is same as MySQL. Maybe it's not a bug, because it's order by collation_name. @wjhuang2016

mysql> SELECT character_set_name, id, sortlen FROM information_schema.collations ORDER BY collation_name, id;
...
| utf8               |  83 |       1 |
| utf8               | 213 |       8 |
| utf8               | 202 |       8 |
| utf8               | 203 |       8 |
| utf8               | 209 |       8 |
| utf8               | 198 |       8 |
| utf8               |  33 |       1 |
| utf8               | 223 |       1 |
| utf8               | 212 |       8 |
| utf8               | 210 |       8 |
| utf8               | 193 |       8 |
| utf8               | 194 |       8 |
| utf8               | 204 |       8 |
| utf8               | 208 |       8 |
| utf8               | 197 |       8 |
| utf8               | 195 |       8 |
| utf8               | 207 |       8 |
| utf8               | 211 |       8 |
| utf8               | 205 |       8 |
| utf8               | 196 |       8 |
| utf8               | 206 |       8 |
| utf8               | 199 |       8 |
| utf8               | 200 |       8 |
| utf8               |  76 |       1 |
| utf8               | 201 |       8 |
| utf8               | 214 |       8 |
| utf8               | 192 |       8 |
| utf8               | 215 |       8 |
+--------------------+-----+---------+

@seiya-annie seiya-annie added the sig/sql-infra SIG: SQL Infra label Jan 27, 2022
@bb7133
Copy link
Member

bb7133 commented Jan 27, 2022

I don't think this issue is worth fixing, since the behavior is the same as MySQL and it doesn't matter for the users actually.

@bb7133 bb7133 closed this as completed Jan 27, 2022
@bb7133 bb7133 added the wontfix This issue will not be fixed. label Jan 27, 2022
@github-actions
Copy link

Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug. wontfix This issue will not be fixed.
Projects
None yet
Development

No branches or pull requests

4 participants