MyBB Community Forums

Full Version: SQL error when viewing forum after upgrade from 1.6.0
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey,

A few hours ago I upgraded my boards from 1.6.0 to 1.6.1. I ran the upgrade.php page fine, checked the admin panel and everything was working. The boards are displayed, but when actually wanting to view a forum I get an error:
MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
    42803 - ERROR: column "t.fid" must appear in the GROUP BY clause or be used in an aggregate function 
Query:
    SELECT t.*, p.displaystyle AS threadprefix, t.username AS threadusername, u.username FROM mybb_threads t LEFT JOIN mybb_users u ON (u.uid = t.uid) LEFT JOIN mybb_threadprefixes p ON (p.pid = t.prefix) WHERE t.fid='14' AND (t.visible='1' OR t.visible='0') GROUP BY t.tid ORDER BY t.sticky DESC, t.lastpost desc LIMIT 20 OFFSET 0 

SQL Engine: PostgreSQL 8.3.12

This is related to this bug-report:
http://dev.mybboard.net/issues/1357


I am hoping someone can tell me where I can try to fix this...since the bug-report doesn't seem to be going anywhere Smile

Kind regards,

Lugus
Ok, a fast fix was removing:
GROUP BY t.tid

in forumdisplay.php

but I guess this circumvents the security change...so would still like to know what the proper fix would be Smile
This isn't anything to do with security, it was for a bug fix if guests are able to rate threads. If guests can't rate threads on your forum, you can remove that bit of the query until a proper solution is found.