Bug #71388 | order by error | ||
---|---|---|---|
Submitted: | 15 Jan 2014 8:14 | Modified: | 24 Feb 2014 12:45 |
Reporter: | qinglin zhang (OCA) | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 5.6.15, 5.5.18 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | select order by varchar text |
[15 Jan 2014 8:14]
qinglin zhang
[15 Jan 2014 15:03]
Peter Laursen
This may be some imperfection and unexpected but unles you use a binary collation or a COLLATE clause in the query I think nobody were ever promised any specific ordering of uppercases or lowercases. Try SELECT * FROM A ORDER BY name COLLATE charset_bin; -- replace "COLLATE charset_bin" with "COLLATE utf8_bin" if your charset is UTF8 etc. Peter (not a MySQL/Oracler person)
[16 Jan 2014 18:05]
Sveta Smirnova
Thank you for the report. I can not repeat described behavior. Please indicate which exact package of MySQL server you are using (file name you downloaded) and provide output of SHOW VARIABLES LIKE '%char%" and SHOW VARIABLES LIKE '%col%'
[24 Jan 2014 1:28]
qinglin zhang
the version is 5.6.15 while the information you need is : root@(none) 09:27:17>SHOW VARIABLES LIKE '%char%'; +--------------------------+---------------------------+ | Variable_name | Value | +--------------------------+---------------------------+ | character_set_client | gbk | | character_set_connection | gbk | | character_set_database | gbk | | character_set_filesystem | binary | | character_set_results | gbk | | character_set_server | gbk | | character_set_system | utf8 | | character_sets_dir | /u01/5615/share/charsets/ | +--------------------------+---------------------------+ 8 rows in set (0.01 sec) root@(none) 09:27:24>SHOW VARIABLES LIKE '%col%'; +---------------------------+----------------+ | Variable_name | Value | +---------------------------+----------------+ | collation_connection | gbk_chinese_ci | | collation_database | gbk_chinese_ci | | collation_server | gbk_chinese_ci | | protocol_version | 10 | | slave_compressed_protocol | OFF | +---------------------------+----------------+ 5 rows in set (0.00 sec)
[24 Jan 2014 12:45]
Sveta Smirnova
Thank you for the feedback. I still cannot repeat described behavior: set names gbk; SHOW VARIABLES LIKE '%col%'; Variable_name Value collation_connection gbk_chinese_ci collation_database gbk_chinese_ci collation_server gbk_chinese_ci protocol_version 10 slave_compressed_protocol OFF create table A(name char(20)) engine=innodb; insert into A values('a'); insert into A values('A'); select * from A order by name ; name a A show full fields from A; Field Type Collation Null Key Default Extra Privileges Comment name char(20) gbk_chinese_ci YES NULL select,insert,update,references create table B (name text) engine=innodb; insert into B values('a'); insert into B values('A'); select * from B order by name ; name a A show full fields from B; Field Type Collation Null Key Default Extra Privileges Comment name text gbk_chinese_ci YES NULL select,insert,update,references Please provide output of SELECT name, HEX(name) FROM A; and SELECT name, HEX(name) FROM B;
[25 Feb 2014 1:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".