logo       

[bug] Fatal error in forum block in MySQL ANSI mode: msg#01027

php.drupal.devel

Subject: [bug] Fatal error in forum block in MySQL ANSI mode

Project: Drupal
Version: cvs
Component: forum.module
Category: bug reports
Priority: normal
Assigned to: Anonymous
Reported by: calanya
Updated by: ax
Status: active

this is a known problem since forum.module exists. see this mail by
Marco Molinari, author of forum.module, for his problem description.

i tried to fix this a couple of times, but never found a solution. as
neither did marco, this probably isn't fixable in an elegant way.

don't hesitate to prove us wrong, though ;)

ax



Previous comments:
------------------------------------------------------------------------

February 28, 2004 - 16:53 : calanya

With MySQL 4.0.18 running in ANSI mode, this query from forum.module,
forum_block():

[?php
$content = node_title_list(db_query_range("SELECT n.nid, n.title,
GREATEST(n.created, MAX(c.timestamp)) AS sort FROM {node} n LEFT JOIN
{comments} c ON n.nid = c.nid WHERE n.type = 'forum' AND n.status = 1
GROUP BY n.nid, n.title, n.created ORDER BY sort DESC", 0,
variable_get('forum_block_num', '5')), t('Active forum topics:'));
?]

Causes this fatal error:


Fatal error: 'sort' isn't in GROUP BY query:
SELECT n.nid, n.title, GREATEST(n.created, MAX(c.timestamp)) AS sort
FROM ng_node n LEFT JOIN ng_comments c ON n.nid = c.nid
WHERE n.type = 'forum' AND n.status = 1
GROUP BY n.nid, n.title, n.created
ORDER BY sort DESC
LIMIT 0, 5


--
View: http://drupal.org/node/view/6113
Edit: http://drupal.org/project/comments/add/6113





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise