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

dawehner’s picture

Why is the executed query different between mysql 5.0 and mysql 5.1?

bojanz’s picture

It'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...

bojanz’s picture

It'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...

altrugon’s picture

Any idea how to fix this?

achton’s picture

Subscribing.

dawehner’s picture

Status: Active » Postponed (maintainer needs more info)

Let'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.

achton’s picture

@altrugon, @bojanz: has this been working for you with Views 3 until recently? Or is that just me?

esmerel’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)