Piwigo Bugtracker

Viewing Issue Advanced Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001740 [Piwigo] photos minor always 2010.06.23 00:22 2010.06.30 00:04
Reporter madman View Status public  
Assigned To nikrou
Priority normal Resolution fixed Platform Postgresql
Status closed   OS CentOS 5.4
Projection none   OS Version Postgresql 8.4.2
ETA none Fixed in Version 2.1.2 Product Version 2.1.1
  Target Version Product Build Trunk r6585
Summary 0001740: [PostgreSQL] Rating page returns database error
Description This is another query that has an incomplete GROUP BY. This in in admin/rating.php line 162.

Proposed query rewrite:

$query = '
SELECT i.id,
       i.path,
       i.file,
       i.tn_ext,
       i.average_rate,
       MAX(r.date) AS recently_rated,
       COUNT(r.rate) AS nb_rates,
       SUM(r.rate) AS sum_rates
  FROM '.RATE_TABLE.' AS r
    LEFT JOIN '.IMAGES_TABLE.' AS i ON r.element_id = i.id
  WHERE 1 = 1 ' . $page['user_filter'] . '
  GROUP BY i.id, i.path, i.file, i.tn_ext, i.average_rate
  ORDER BY ' . $available_order_by[$order_by_index][1] .'
  LIMIT '.$elements_per_page.' OFFSET '.$start.'
;';
Steps To Reproduce New installation -> Administration -> Photos -> Rating
Additional Information Warning: pg_query() [function.pg-query]: Query failed: ERROR: column "i.id" must appear in the GROUP BY clause or be used in an aggregate function LINE 2: SELECT i.id, ^ in /var/www/sites/fotos.aarjan.nl/piwigo/piwigo_svn/include/dblayer/functions_pgsql.inc.php on line 122
SELECT i.id, i.path, i.file, i.tn_ext, i.average_rate, MAX(r.date) AS recently_rated, COUNT(r.rate) AS nb_rates, SUM(r.rate) AS sum_rates FROM piwigo_rate AS r LEFT JOIN piwigo_images AS i ON r.element_id = i.id WHERE 1 = 1 GROUP BY r.element_id ORDER BY recently_rated DESC LIMIT 10 OFFSET 0 ;
ERROR: column "i.id" must appear in the GROUP BY clause or be used in an aggregate function LINE 2: SELECT i.id, ^
Tags No tags attached.
browser Mozilla
Database engine and version Postgresql 8.4.2
PHP version 5.3.2
Web server Apache 2.2.3
Attached Files

- Relationships

-  Notes
(0004008)
svn (reporter)
2010.06.25 23:19

[Subversion] r6606 by nikrou on branch 2.1

-----[Subversion commit log]----------------------------------------------------
Bug 1740 fixed : Rating page returns database error
Query had incomplete group by clause
(0004009)
svn (reporter)
2010.06.25 23:21

[Subversion] r6607 by nikrou on trunk

-----[Subversion commit log]----------------------------------------------------
Bug 1740 fixed : Bug 1740 fixed : Rating page returns database error
Query had incomplete group by clause
Merge from branch 2.1

- Issue History
Date Modified Username Field Change
2010.06.23 00:22 madman New Issue
2010.06.23 00:22 madman browser => Mozilla
2010.06.23 00:22 madman Database engine and version => Postgresql 8.4.2
2010.06.23 00:22 madman PHP version => 5.3.2
2010.06.23 00:22 madman Web server => Apache 2.2.3
2010.06.23 20:18 nikrou Status new => assigned
2010.06.23 20:18 nikrou Assigned To => nikrou
2010.06.25 23:19 svn Checkin
2010.06.25 23:19 svn Note Added: 0004008
2010.06.25 23:21 svn Checkin
2010.06.25 23:21 svn Note Added: 0004009
2010.06.25 23:21 nikrou Status assigned => closed
2010.06.25 23:21 nikrou Resolution open => fixed
2010.06.25 23:21 nikrou Fixed in Version => 2.1.2
2010.06.30 00:04 plg Summary Rating page returns database error => [PostgreSQL] Rating page returns database error


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Contact
Powered by Mantis Bugtracker