Closed (cannot reproduce)
Project:
Views (for Drupal 7)
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Jan 2011 at 00:59 UTC
Updated:
28 Feb 2011 at 14:14 UTC
With MySQL 5.0.41 I get the following error:
user warning: Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause query: SELECT COUNT(term_node.nid) AS termcount, node_term_node.vid AS node_term_node_vid FROM term_data term_data LEFT JOIN term_node term_node ON term_data.tid = term_node.tid INNER JOIN node node_term_node ON term_node.vid = node_term_node.vid WHERE (node_term_node.type in ('blog')) AND (node_term_node.nid = 7 ) ORDER BY termcount DESC LIMIT 0, 15 in .../modules/buildkit/views/plugins/views_plugin_query_default.inc on line 1137.
This is not happening with MySQL 5.1.44, but my guess is that the right query should look like:
SELECT COUNT(term_node.nid) AS termcount, node_term_node.vid AS node_term_node_vid FROM term_data term_data LEFT JOIN term_node term_node ON term_data.tid = term_node.tid INNER JOIN node node_term_node ON term_node.vid = node_term_node.vid WHERE (node_term_node.type in ('blog')) AND (node_term_node.nid = 7 ) GROUP BY node_term_node_vid ORDER BY termcount DESC LIMIT 0, 15
where the GROUP BY clause has been added.
Comments
Comment #1
dawehnerWhy is the executed query different between mysql 5.0 and mysql 5.1?
Comment #2
bojanz commentedIt's not, it's just that one version throws the error, while the other swallows the query.
Still, using aggregate functions without group by is wrong...
Comment #3
bojanz commentedIt's not, it's just that one version throws the error, while the other swallows the query.
Still, using aggregate functions without group by is wrong...
Comment #4
altrugon commentedAny idea how to fix this?
Comment #5
achtonSubscribing.
Comment #6
dawehnerLet's read http://drupal.org/node/571990 and try to provide some more informations.
It is critical as always to be able to reproduce the problem.
Comment #7
achton@altrugon, @bojanz: has this been working for you with Views 3 until recently? Or is that just me?
Comment #8
esmerel commented