Bug 15302

Summary: Use of LIMIT in reports breaks pagination
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: ReportsAssignee: Galen Charlton <gmcharlt>
Status: CLOSED WORKSFORME QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: magnus
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

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.