question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

offset x is not a multiple of limit y

See original GitHub issue

Why is this check performed?

https://github.com/crnk-project/crnk-framework/blob/77fffa6023f49550852d6c55cfe7c27956a07a87/crnk-core/src/main/java/io/crnk/core/queryspec/pagingspec/OffsetLimitPagingBehavior.java#L99-L105

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:open
  • Created 5 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
weaselmetalcommented, Apr 20, 2018

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.

0reactions
remmeiercommented, Apr 19, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found