[MDEV-27431] Datetime order by and limit offset not working Created: 2022-01-06 Updated: 2022-01-07 Resolved: 2022-01-07 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Server |
| Affects Version/s: | 10.5.12, 10.7.1 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Critical |
| Reporter: | Geoffrey Saleur | Assignee: | Sergei Golubchik |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
from docker image : docker run --rm -e MYSQL_ROOT_PASSWORD=azerty -e TZ=Europe\Paris -it mariadb:10.7.1 |
||
| Attachments: |
|
| Description |
|
Example :
|
| Comments |
| Comment by Sergei Golubchik [ 2022-01-06 ] | ||||||||||||||||||
|
What is the error there? What result do you expect those queries to return? | ||||||||||||||||||
| Comment by Geoffrey Saleur [ 2022-01-06 ] | ||||||||||||||||||
|
For this request : select * from test order by b limit 3 offset 1 But the command return this :
If we reverse the order we have the same problem: But the command return this :
| ||||||||||||||||||
| Comment by Sergei Golubchik [ 2022-01-07 ] | ||||||||||||||||||
|
Thanks. Now I can see where a confusion is. OFFSET is specified in the number of rows. OFFSET 1 means "skip one row, start from the second one". For your desired results you should use LIMIT 3 OFFSET 3 |