[MDEV-18740] ORDER BY DESC + LIMIT x,1 on same columns' values are wrong Created: 2019-02-26 Updated: 2019-02-26 Resolved: 2019-02-26 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | N/A |
| Affects Version/s: | 10.2.22 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Angel T | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Description |
|
ASC is correct: DESC is wrong (#2): How to repeat: |
| Comments |
| Comment by Alice Sherepa [ 2019-02-26 ] |
|
The results are correct, as the value of the RateUp is the same, so there is no guarantee which of those 2 rows will be the first and which is the second in the results. |
| Comment by Angel T [ 2019-02-26 ] |
|
MySQL innodb_version 5.7.12 or innodb_version 5.7.24 are correct, not MariaDB |
| Comment by Alice Sherepa [ 2019-02-26 ] |
|
"If multiple rows have identical values in the ORDER BY columns, the server is free to return those rows in any order, and may do so differently depending on the overall execution plan. In other words, the sort order of those rows is nondeterministic with respect to the nonordered columns." https://dev.mysql.com/doc/refman/8.0/en/limit-optimization.html |
| Comment by Angel T [ 2019-02-26 ] |
|
In MySQL ASC and DESC work as expected. |