nodecomment_page_count breaks in PostgreSQL. But why?

Josh Waihi - September 30, 2009 - 22:01
Project:Node comments
Version:6.x-2.0-beta1
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:active
Description

this query failed in PostgreSQL because it lacks a GROUP BY clause which is required when using a ORDER BY:

SELECT COUNT(*) FROM node_comments nc INNER JOIN node n ON n.nid = nc.cid WHERE nc.thread <= '' AND n.status <> 0 AND n.nid != 122 AND nc.nid = 121 ORDER BY nc.thread ASC;

However, where counting here, not trying to retrive particular columns, so why are we even bothering with ordering the returned dataset. It merely slows the query.

 
 

Drupal is a registered trademark of Dries Buytaert.