[Koha-bugs] [Bug 2982] SQL for count or sum produces multiple blank output pages, odd screen display

bugzilla-daemon at liblime.com bugzilla-daemon at liblime.com
Sat May 23 23:49:38 CEST 2009


http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=2982


Garry Collum <gcollum at hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gcollum at hotmail.com




--- Comment #5 from Garry Collum <gcollum at hotmail.com>  2009-05-23 21:49:37 ---
It looks like the problem is the select_2_select_count subroutine in
C4::Reports::Guided.pm.  This is called by select_2_select_count_value
subroutine which returns the total number of rows of an sql query for the
purpose of creating pagination.

select_2_select_count removes all of the text between the SELECT and FROM and
replaces it with SELECT count(*) FROM.  If an aggregate SQL statement is used
in a report, ie 'SELECT Count(*) FROM borrower' select_2_select_count replaces
'SELECT count(*)' with 'SELECT count(*)' to get the total number of rows for
the query.

The Fix?  You can't assume that an aggregate function will return just one row
of data.  It may be grouped.  The best fix would be to get the actual number of
rows returned from the query via DBI.  I haven't poked around enough to figure
out where to do this. 


-- 
Configure bugmail: http://bugs.koha.org/cgi-bin/bugzilla3/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the Koha-bugs mailing list