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.

CommentFileSizeAuthor
#2 nodecomment_592564.patch848 bytescrea

Comments

crea’s picture

Version: 6.x-2.0-beta1 » 6.x-2.0-beta3

Yep, the query doesn't make sense.

crea’s picture

Title: nodecomment_page_count breaks in PostgreSQL. But why? » nodecomment_page_count uses wrong SQL query.
Status: Active » Needs review
StatusFileSize
new848 bytes

Please try this patch.

crea’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.