Bug 3419

Summary: Downloaded saved reports do not contain all records
Product: Koha Reporter: Chris Cormack <chris>
Component: ReportsAssignee: Galen Charlton <gmcharlt>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: PATCH-Sent (DO NOT USE) CC: chris, cookie.wolfrom, dschust1, jwagner, koha.sekjal, mcoalwell, nengard, wizzyrea
Version: rel_3_2   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 34840    
Attachments: Followup patch to bug 3419

Description Chris Cormack 2010-05-21 01:10:17 UTC


---- Reported by bchurch@ptfs.com 2009-07-14 18:52:14 ----

If you run the following query as a saved report and download the results, the file does not contain all the records which you viewed in Koha:

SELECT  borrowers.surname, borrowers.firstname, borrowers.address, borrowers.city, borrowers.zipcode FROM borrowers ORDER BY borrowers.surname asc

In Koha you can see all patrons from A to Z. The downloaded file only contains patron records up to the letter D. The database has 71,755 patron records.



---- Additional Comments From jwagner@ptfs.com 2009-08-03 15:06:20 ----

I thought I'd reported a bug a while back, but I can't find it.  So far as I can tell, any report download truncates at 10,000 records.  The screen display shows more, but the downloaded .csv file cuts off at that point.



---- Additional Comments From wizzyrea@gmail.com 2009-08-03 15:12:35 ----

Tab Separated has the same limitation. 




---- Additional Comments From chris@bigballofwax.co.nz 2009-08-25 12:29:34 ----

Yep it's this line here, line 399 of C4/Reports/Guided.pm

$limit  = 9999 unless $limit;

Last changed at the end of March. I'm guessing it was added to stop people killing their Koha by putting some sql that returned millions and millions of rows by accident.

If you put a limit in your query, say 15000, then you should get 15000

eg SELECT * FROM items LIMIT 15000



---- Additional Comments From chris@bigballofwax.co.nz 2010-01-04 17:55:26 ----

The code also needs changing

Michael hafen has sent a patch

http://lists.koha.org/pipermail/koha-patches/2009-November/004815.html



---- Additional Comments From gmcharlt@gmail.com 2010-05-10 22:25:05 ----

(In reply to comment #4)
> The code also needs changing
> 
> Michael hafen has sent a patch
> 
> http://lists.koha.org/pipermail/koha-patches/2009-November/004815.html
> 

The patch in question was pushed in November.  Can this bug be closed?



--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 01:10 UTC  ---

This bug was previously known as _bug_ 3419 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=3419

Actual time not defined. Setting to 0.0
The original reporter of this bug does not have
   an account here. Reassigning to the person who moved
   it here: chris@bigballofwax.co.nz.
   Previous reporter was bchurch@ptfs.com.
CC member jwagner@ptfs.com does not have an account here

Comment 1 Ian Walls 2010-07-12 18:23:13 UTC
There is a small typo in this patch:

} elsif ( ! $offset && $limit > $userlimit ) {

should read:

} elsif ( ! $offset && $limit < $userlimit ) {

otherwise the userlimit is only being respected if it's below the code's inherent limit of 9999, which does not address the complaint in this bug report.
Comment 2 Ian Walls 2010-07-12 18:28:39 UTC
Created attachment 2349 [details] [review]
Followup patch to bug 3419

This patch corrects the inequality typo in the already-pushed patch.
Comment 3 Galen Charlton 2010-07-12 20:48:01 UTC
Pushed follow-up patch.  Please test and close.
Comment 4 Ian Walls 2010-09-25 19:44:37 UTC
Functional for the last few months without recurrence.  Closing.