logo       

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

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: calanya
Status: active

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


calanya

--
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