Download & Extend

nodecomment_page_count uses wrong SQL query.

Project:Node Comments
Version:6.x-2.0-beta3
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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.

Comments

#1

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

Yep, the query doesn't make sense.

#2

Title:nodecomment_page_count breaks in PostgreSQL. But why?» nodecomment_page_count uses wrong SQL query.
Status:active» needs review

Please try this patch.

AttachmentSize
nodecomment_592564.patch 848 bytes

#3

Status:needs review» fixed

#4

Status:fixed» closed (fixed)

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

nobody click here