I am using the latest dev version, and the "Last Post" section was showing up normally. Today I did some updates to my server (upgrading to Centos 5.2), and the "Last Post" now only shows 'na' :
http://chelmsfordmc.co.uk/forum - Advanced forum has been running with great success on this production site - thank you!
The Drupal log has lots of messages like this:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DISTINCT(n.nid), n.type, ncs.last_comment_timestamp, IF (ncs.last_comment_uid !=' at line 1 query: SELECT n.title, DISTINCT(n.nid), n.type, ncs.last_comment_timestamp, IF (ncs.last_comment_uid != 0, u2.name, ncs.last_comment_name) AS last_comment_name, ncs.last_comment_uid FROM node n INNER JOIN users u1 ON n.uid = u1.uid INNER JOIN term_node tn ON n.nid = tn.nid INNER JOIN node_comment_statistics ncs ON n.nid = ncs.nid INNER JOIN users u2 ON ncs.last_comment_uid=u2.uid WHERE n.status = 1 AND n.type='forum' AND tn.tid = 19 ORDER BY ncs.last_comment_timestamp DESC LIMIT 0, 1 in /home/chelmsf/chelmsfordmc.co.uk/includes/database.mysql.inc on line 172.
As MySQL was changed in the server update I just did, I expect this is the culprit:
Aug 05 16:31:46 Updated: mysql.i386 5.0.45-7.el5
Aug 05 16:32:38 Updated: mysql-server.i386 5.0.45-7.el5
Could any of the "incompatible changes" listed here have broken it?
http://dev.mysql.com/doc/refman/5.0/en/releasenotes-cs-5-0-45.html
Comments
Comment #1
rallycivic commentedThe query that is failing with MySQL 5.0.45 is on line 1051 in advanced_forum.module.
I have lost the errors by commenting it out.
The comment above the query is interesting. Is there a "full ANSI syntax" version that I could give a try?
Comment #2
michelle"Is there a "full ANSI syntax" version that I could give a try?"
No idea. This is core forum code and I don't know anything about the query or what that means. Someone with more MySQL knowledge than I have will have to answer it.
It works fine on "5.0.51a-community" so maybe something different about your version.
Michelle
Comment #3
rallycivic commentedThat was a good clue. I tried pasting the query from the core forum, which doesn't fail.
The only difference was that "n.title, n.nid, n.type," has been added to the start of the query in advance_forum.
As the n.nid becomes DISTINCT(n.nid) after being passed through db_rewrite_sql(), I tried moving it to to the beginning. This works!
Thanks,
Tony
Comment #4
michelleComitted to both branches. Thanks for the fix. Never would have occured to me that it mattered whether the title or nid came first. Crazy!
Michelle
Comment #5
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.