Bug 21941 - Incorrect GROUP BY in circ/reserveratios.pl
Summary: Incorrect GROUP BY in circ/reserveratios.pl
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
Depends on:
Blocks: 17258
  Show dependency treegraph
Reported: 2018-12-04 15:01 UTC by Nick Clemens
Modified: 2020-10-28 08:08 UTC (History)
4 users (show)

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


Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2018-12-04 15:01:15 UTC
DBD::mysql::st execute failed: 'koha_kohadev.reserves.reservedate' isn't in GROUP BY [for Statement "SELECT reservedate,
        reserves.borrowernumber as borrowernumber,
        reserves.branchcode as branch,
        GROUP_CONCAT(DISTINCT items.itemcallnumber 
            ORDER BY items.itemnumber SEPARATOR '|') as listcall,
        GROUP_CONCAT(DISTINCT homebranch
            ORDER BY items.itemnumber SEPARATOR '|') as homebranch_list,
        GROUP_CONCAT(DISTINCT holdingbranch 
            ORDER BY items.itemnumber SEPARATOR '|') as holdingbranch_list,
        GROUP_CONCAT(DISTINCT items.location 
            ORDER BY items.itemnumber SEPARATOR '|') as l_location,
        GROUP_CONCAT(DISTINCT items.itype 
            ORDER BY items.itemnumber SEPARATOR '|') as l_itype,

        count(DISTINCT reserves.borrowernumber) as reservecount, 
        count(DISTINCT items.itemnumber)  as itemcount
 FROM  reserves
 LEFT JOIN items ON items.biblionumber=reserves.biblionumber 
 LEFT JOIN biblio ON reserves.biblionumber=biblio.biblionumber
 notforloan = 0 AND damaged = 0 AND itemlost = 0 AND withdrawn = 0
  AND reservedate >= ? AND reservedate <= ?
 GROUP BY reserves.biblionumber ORDER BY reservecount DESC" with ParamValues: 0='2017-12-04 00:00', 1='2018-12-04 00:00'] at /home/vagrant/kohaclone/circ/reserveratios.pl line 150.
Comment 1 Jonathan Druart 2018-12-10 19:39:41 UTC
This is a hard one. I have tried several weeks ago with circ/pendingreserves.pl that has the same problem but decided to postpone it :-/