| Bug #94413 | order by function is inconsistent, or wrong. | ||
|---|---|---|---|
| Submitted: | 20 Feb 2019 15:04 | Modified: | 20 Feb 2019 15:43 |
| Reporter: | Larry Vogler | Email Updates: | |
| Status: | Unsupported | Impact on me: | |
| Category: | MySQL Server: DML | Severity: | S3 (Non-critical) |
| Version: | 5.0.12 | OS: | CentOS |
| Assigned to: | CPU Architecture: | Any | |
| Tags: | select order by | ||
[20 Feb 2019 15:43]
MySQL Verification Team
Thank you for the bug report. 5.0 version is quite older and EOL, please try a new version 5.7 or 8.0 and comment here if still find the same issue. https://www.mysql.com/support/eol-notice.html

Description: Suppose a table contains the following, call the row I, in a row. Cat cat dog Fred select I order by I returns Cat cat dog Fred this is a bug. Fred is less than cat. You might say it is arbitrary, ok. Then select I where I > 'cat' order by I should return Fred. It does not. You cannot have it both ways. Of course you can, obviously you do. select I order by I should return, by default, Cat Fred cat dog. what do you do to get the expected behavior? Make cat uppercase in the select I where I > 'CAT' order by I query. How to repeat: I think anybody can do it. Suggested fix: Respect case in the order by sort. Pretty simple example. when you are actually dealing with thousands of rows you can just miss all the rows with uppercase if you forget to do the uppercase.