Hello,
Using PostgreSQL, when I try to create a simple queue (admin/structure/nodequeue/add/nodequeue) I have the following error :

PDOException : SQLSTATE[42803]: Grouping error: 7 ERREUR: the column « q.title » must appears in the GROUP BY clause or be used in an aggregate function LINE 1: SELECT q.*, COUNT(s.sqid) AS subqueues FROM nodequeue_queue ... ^: SELECT q.*, COUNT(s.sqid) AS subqueues FROM {nodequeue_queue} q LEFT JOIN {nodequeue_subqueue} s ON q.name = s.name WHERE q.name IN (:to_load_0) GROUP BY q.name; Array ( [:to_load_0] => add ) in nodequeue_load_queues() (line 614 in .../sites/all/modules/contrib/nodequeue/nodequeue.module).

PS: I tried to translate the error the best as I can from french.

Comments

IcanDivideBy0’s picture

Issue summary: View changes

formatting error

IcanDivideBy0’s picture

Priority: Normal » Critical
Status: Active » Needs work

I can't get this module working (at least the main functionality which is create a simple queue) using PostgreSQL.

amateescu’s picture

Priority: Critical » Major
Status: Needs work » Needs review
StatusFileSize
new1.99 KB

Can you try this patch?

IcanDivideBy0’s picture

StatusFileSize
new370 bytes

Your patch works well, but still got an error :

PDOException : SQLSTATE[22P02]: Invalid text representation: 7 ERREUR: invalid syntax for integer : « add » LINE 1: ...) AS subqueues FROM nodequeue_queue q WHERE q.qid IN ('add') ^: SELECT q.*, (SELECT count(*) FROM {nodequeue_subqueue} s WHERE q.qid = s.qid) AS subqueues FROM {nodequeue_queue} q WHERE q.qid IN (:to_load_0); Array ( [:to_load_0] => add ) dans nodequeue_load_queues() (line 613 in .../sites/all/modules/contrib/nodequeue/nodequeue.module).

The attached patch fixed it (in addition with yours).

Status: Needs review » Needs work

The last submitted patch, 1475396_cast_int.patch, failed testing.

IcanDivideBy0’s picture

Status: Needs work » Needs review
StatusFileSize
new614 bytes

Assuming the same thing has to be done in nodequeue_load_subqueues

Status: Needs review » Needs work

The last submitted patch, 1475396_cast_int.patch, failed testing.

IcanDivideBy0’s picture

Version: 7.x-3.x-dev » 7.x-2.x-dev

The patch only applies for 7.x-2.x branch

IcanDivideBy0’s picture

Status: Needs work » Needs review

#5: 1475396_cast_int.patch queued for re-testing.

amateescu’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
Status: Needs review » Needs work

Hm, wait a minute, what branch (and module version) are you actually using? Because my patch was for 7.x-3.x but yours is for 7.x-2.x :)

amateescu’s picture

Version: 7.x-3.x-dev » 7.x-2.x-dev
Status: Needs work » Needs review
StatusFileSize
new2.2 KB

Hm, seems that the 7.x-2.x already had the PostgreSQL fixes applied, so in the attached patch I just uppercase some COUNTs along your (int) castings. Can you confirm that this fixes the problem on 7.x-2.x?

IcanDivideBy0’s picture

Status: Needs review » Needs work

Now, getting an issue while showing a view ordered by the queue :

PDOException : SQLSTATE[42803]: Grouping error: 7 ERREUR: the column « q.sqid » must appears in the GROUP BY clause or be used in an aggregate function LINE 1: SELECT s.*, COUNT(n.position) AS count ^: SELECT s.*, COUNT(n.position) AS count FROM {nodequeue_subqueue} s LEFT OUTER JOIN {nodequeue_nodes} n ON n.sqid = s.sqid WHERE (( (s.qid = :db_condition_placeholder_0) AND (s.reference IN (:db_condition_placeholder_1)) )) GROUP BY s.sqid; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => 1 ) dans nodequeue_load_subqueues_by_reference() (ligne 794 dans .../sites/all/modules/contrib/nodequeue/nodequeue.module).
amateescu’s picture

Status: Needs work » Needs review
StatusFileSize
new2.72 KB

How about now?

IcanDivideBy0’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new2.73 KB

Works fine.
Just added a missing parenthesis in the last modified query.

raccer’s picture

StatusFileSize
new2.63 KB

So the various GROUP BYs in 7.x-2.x (lines 615, 702, & 756 (&787, but the patch above fixed it) are killing my pager re drupal pager disappears when adding GROUP BY in sql I was thinking this might be a separate bug than above; I tried the 1475396-13-7.x-2.x.patch but the first 3/4 hunks failed. I'm new to patching so... amidoinitrite? Should I file a new bug? Thanks!

drifter’s picture

StatusFileSize
new2.23 KB

Rerolling patch #13, it now applies to 2.x-dev and works fine with postgres. Can we get it committed?

drifter’s picture

Issue summary: View changes

formatting error again

fizk’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Postponed (maintainer needs more info)

I'm not able to reproduce this error using the latest 7.x-2.x-dev. If this issue still effects anyone, please describe how to reproduce this issue.

fizk’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

If this issue still effects anyone, please reopen and describe how to reproduce.