Hi Guys,

The count query seems to add GROUP BY for fields I did not specify:

SELECT COUNT(*) FROM (SELECT COUNT(DISTINCT(node.nid)) AS nid, node_node_data_field_mention_url.nid AS node_node_data_field_mention_url_nid, node_node_data_field_mention_url_node_data_field_url_url.field_url_url_url AS node_node_data_field_mention_url_node_data_field_url_url_field_url_url_url, node_node_data_field_mention_url_node_data_field_url_url.field_url_url_title AS node_node_data_field_mention_url_node_data_field_url_url_field_url_url_title, node_node_data_field_mention_url_node_data_field_url_url.field_url_url_attributes AS node_node_data_field_mention_url_node_data_field_url_url_field_url_url_attributes, node_node_data_field_mention_url.type AS node_node_data_field_mention_url_type, node_node_data_field_mention_url.vid AS node_node_data_field_mention_url_vid, node_node_data_field_mention_url_node_data_field_rank.field_rank_value AS node_node_data_field_mention_url_node_data_field_rank_field_rank_value, node_node_data_field_mention_url_node_data_field_mention_tag_count.field_mention_tag_count_value AS node_node_data_field_mention_url_node_data_field_mention_tag_count_field_mention_tag_count_value FROM node node LEFT JOIN content_type_sm_mention node_data_field_mention_url ON node.vid = node_data_field_mention_url.vid INNER JOIN node node_node_data_field_mention_url ON node_data_field_mention_url.field_mention_url_nid = node_node_data_field_mention_url.nid INNER JOIN content_type_sm_mention node_data_field_mention_type ON node.vid = node_data_field_mention_type.vid INNER JOIN users users ON node.uid = users.uid LEFT JOIN content_type_sm_url node_node_data_field_mention_url_node_data_field_url_url ON node_node_data_field_mention_url.vid = node_node_data_field_mention_url_node_data_field_url_url.vid LEFT JOIN content_field_rank node_node_data_field_mention_url_node_data_field_rank ON node_node_data_field_mention_url.vid = node_node_data_field_mention_url_node_data_field_rank.vid LEFT JOIN content_field_mention_tag_count node_node_data_field_mention_url_node_data_field_mention_tag_count ON node_node_data_field_mention_url.vid = node_node_data_field_mention_url_node_data_field_mention_tag_count.vid WHERE (node.type in ('sm_mention')) AND (node_data_field_mention_type.field_mention_type_value = 'microblogs') AND (users.uid = 3) GROUP BY node_node_data_field_mention_url_nid, node_node_data_field_mention_url_node_data_field_mention_tag_count_field_mention_tag_count_value, node_node_data_field_mention_url_node_data_field_rank_field_rank_value, nid ORDER BY node_node_data_field_mention_url_node_data_field_rank_field_rank_value DESC, node_node_data_field_mention_url_node_data_field_mention_tag_count_field_mention_tag_count_value DESC, node_node_data_field_mention_url_node_data_field_rank_field_rank_value DESC ) count_alias

I only specified for GROUP ON for the node_node_data_field_mention_url_nid field and not the others. The aggregate count was requested only for node.nid (nid).

Comments

lordg’s picture

This error also happened on the normal query (for the data) as well. What is also seems important about this error is it works for the admin user, but not for a non admin user, yet I don't know how that is related to the fact that the GROUP BY should only be using one field, the one I selected in the Views UI.