[MDEV-10733] record appear mutiply time in pagination query order by column with same value Created: 2016-09-03 Updated: 2016-09-03 Resolved: 2016-09-03 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.1.17 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Critical |
| Reporter: | Jarod Liu | Assignee: | Unassigned |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
CentOS 7 64bit |
||
| Description |
|
with mariadb 10.1, the record with id 8 appear twice
and mariadb 5.5 works as expected:
|
| Comments |
| Comment by Elena Stepanova [ 2016-09-03 ] |
|
You are ordering the result set by a non-unique column. You can only expect that if Name_1 < Name_2, then all rows with Name_1 will come earlier (in case of ASC) or later (in case of DESC) than all rows with Name_2. There is nothing that guarantees any specific order inside a group with the same Name. Technically, you can even get different results running the same query, e.g. one with LIMIT 0,2, although in practice it rarely happens; and of course, the next query knows nothing about the previous query. It used to work on 5.5 – yes, it might well be true, but it worked by pure luck, the behavior has never been defined and guaranteed. See also https://bugs.mysql.com/bug.php?id=69732 for longer discussion. |