MyBB Community Forums
[F] [PostgreSQL] Usergoup group by - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Community Archive (https://community.mybb.com/forum-106.html)
+--- Forum: Archived Forums (https://community.mybb.com/forum-143.html)
+---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html)
+----- Forum: Archived Bug Reports (https://community.mybb.com/forum-74.html)
+------ Forum: MyBB 1.4.2 (https://community.mybb.com/forum-100.html)
+------ Thread: [F] [PostgreSQL] Usergoup group by (/thread-40922.html)



[F] [PostgreSQL] Usergoup group by - Gibheer - 11-24-2008

There is a bug in the usercp.php line 2527 at the select of the usergroups.
MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
    42803 - ERROR: column "g.title" must appear in the GROUP BY clause or be used in an aggregate function 
Query:
    SELECT g.title, g.gid, g.type, COUNT(u.uid) AS users, COUNT(j.rid) AS joinrequests, l.canmanagerequests, l.canmanagemembers FROM zero_groupleaders l LEFT JOIN zero_usergroups g ON(g.gid=l.gid) LEFT JOIN zero_users u ON(((','|| u.additionalgroups|| ',' LIKE '%,'|| g.gid|| ',%') OR u.usergroup = g.gid)) LEFT JOIN zero_joinrequests j ON(j.gid=g.gid) WHERE l.uid='1' GROUP BY g.gid

You have to give all columns which are listed in the select-statement.
I changed the group by into the following and it works, as far as I can see.
GROUP BY g.gid, g.title, g.type, l.canmanagerequests, l.canmanagemembers



[F] [PostgreSQL] Usergoup group by - Ryan Gordon - 11-27-2008

Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.

With regards,
MyBB Group