Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[F] [PostgreSQL] Usergoup group by
#1
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


Messages In This Thread
[F] [PostgreSQL] Usergoup group by - by Gibheer - 11-24-2008, 05:45 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)