MyBB Community Forums

Full Version: [F] [PostgreSQL] Usergoup group by
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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
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