Bug 15302 - Use of LIMIT in reports breaks pagination
Summary: Use of LIMIT in reports breaks pagination
Status: CLOSED WORKSFORME
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Galen Charlton
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-03 22:09 UTC by Nick Clemens (kidclamp)
Modified: 2024-07-04 20:37 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2015-12-03 22:09:12 UTC
When creating a SQL report if you add a LIMIT ### statement the results are correctly returned, however, pagination links at the top of the page alter only the starting point of results and all results are displayed on one page.

To clarify:
Create a report with over 100 results and specify LIMIT 100
You will see the first 100 results for the report on the first page with link to 5 pages at the top
Clicking on page 2 will take you to a new page displaying results 21-100 on a single page

Note:
Many libraries use limit to specifically make all results appear on one page.  
Suggested resolution would be to remove pagination when LIMIT is present in report
Comment 1 Magnus Enger 2022-03-30 12:44:12 UTC
Still a problem. Here is another variant: 

Create a report that shows e.g. 400 results. Add "LIMIT 500" to the query. All 400 results will display, but there will also be pagination links.
Comment 2 Katrin Fischer 2023-08-28 20:02:46 UTC
I cannot replicate any issues with using LIMIT. I tried a limit lower than the total of results and one with greater than the total of results.