offset x is not a multiple of limit y
See original GitHub issueWhy is this check performed?
It’s throwing errors like:
offset 60 is not a multiple of limit 100
Even though this is a perfectly valid query:
SELECT * FROM tbl LIMIT 60,100;
/cc @mohlek
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Is LIMIT x, y absolutely equivalent to OFFSET ... - Stack Overflow
1 Answer 1 · Yep, they're functionally equivalent (produce the same results), but I'm curious to know whether low level stuff, ie memory ......
Read more >SQL - LIMIT and OFFSET - The Data School by Chartio
Learn how to LIMIT the number of results that are returned you can simply use the LIMIT SQL command at the end of...
Read more >MySQL LIMIT & OFFSET with Examples - Guru99
The limit keyword is used to limit the number of rows returned in a query result. It can be used in conjunction with...
Read more >Documentation: 15: 7.6. LIMIT and OFFSET - PostgreSQL
If a limit count is given, no more than that many rows will be returned (but possibly fewer, if the query itself yields...
Read more >How to use limit and offset in PostgreSQL - EDB Postgres
The ordering of the 4 rows is unknown because an ORDER BY clause was not included. Since above it mentions that its important...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just because I realized why this check makes sense: It ensures compatibility between QueryParams and QuerySpec! Once the check is gone, you cannot correctly transform offset and limit into page size and number. So if someone has a setup with both parameter transporting objects, removing the check may cause issues. Just to keep that in mind.
I guess @weaselmetal figured out the history. Once upon a time QueryParams was also still the main thing and QuerySpec the add-on on top of it.
Ideally the check gets deferred till it is actually needed. Support for number/size next to offset/limit is coming in the near future. And interoperability between the two would be quite important to not have to implement reusable repositories for both paging behaviors.