From: Greg Sabino Mullane Date: Thu, 12 Mar 2009 14:26:05 +0000 (+0000) Subject: Add all columns to GROUP BY for databases that need them (e.g. not MySQL). X-Git-Tag: 1.31.0-rc.0~42511 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=c72fb7a1776e1c0c4673f0004b3491786827ad8f;p=lhc%2Fweb%2Fwiklou.git Add all columns to GROUP BY for databases that need them (e.g. not MySQL). Fixes bug 17676 --- diff --git a/includes/specials/SpecialListfiles.php b/includes/specials/SpecialListfiles.php index d2178ee02f..3953a53819 100644 --- a/includes/specials/SpecialListfiles.php +++ b/includes/specials/SpecialListfiles.php @@ -77,7 +77,13 @@ class ImageListPager extends TablePager { # Depends on $wgMiserMode if( isset($this->mFieldNames['COUNT(oi_archive_name)']) ) { $tables[] = 'oldimage'; - $options = array('GROUP BY' => 'img_name'); + $dbr = wfGetDB( DB_SLAVE ); + if( $dbr->implicitGroupby() ) { + $options = array('GROUP BY' => 'img_name'); + } else { + $columnlist = implode( ',', preg_grep( '/^img/', array_keys( $this->getFieldNames() ) ) ); + $options = array('GROUP BY' => "img_user, $columnlist"); + } $join_conds = array('oldimage' => array('LEFT JOIN','oi_name = img_name') ); } return array(