MyBB Community Forums
[Error Message] SQL Error: 1055 - Expression #6 of SELECT list is not in GROUP BY clause - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: [Error Message] SQL Error: 1055 - Expression #6 of SELECT list is not in GROUP BY clause (/thread-189139.html)



SQL Error: 1055 - Expression #6 of SELECT list is not in GROUP BY clause - derEdgar - 02-18-2016

I get this error on a new 1.8.6. installation on the /usercp.php?action=usergroups page for every user (Administratior and registered user).
No custom user groups are created.


SQL Error:
    1055 - Expression #6 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'mybb.l.canmanagerequests' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
Query:
    SELECT g.title, g.gid, g.type, COUNT(DISTINCT u.uid) AS users, COUNT(DISTINCT j.rid) AS joinrequests, l.canmanagerequests, l.canmanagemembers, l.caninvitemembers FROM mybb_groupleaders l LEFT JOIN mybb_usergroups g ON(g.gid=l.gid) LEFT JOIN mybb_users u ON(((CONCAT(',', u.additionalgroups, ',') LIKE CONCAT('%,', g.gid, ',%')) OR u.usergroup = g.gid)) LEFT JOIN mybb_joinrequests j ON(j.gid=g.gid AND j.uid != 0) WHERE l.uid='1' GROUP BY l.gid 

PHP: 5.6.18
MySQL: 5.7.10


RE: SQL Error: 1055 - Expression #6 of SELECT list is not in GROUP BY clause - Devilshakerz - 02-18-2016

Already fixed on GitHub, will be shipped with MyBB 1.8.7: https://github.com/mybb/mybb/issues/2306. You can apply these changes to make it work now: https://github.com/Stefan-ST/mybb/commit/78c05046af245bad90eb0f771bcdef2433afe959