Been searching around thr root cause that produced this terrible warnings:

# user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DISTINCT(node.nid), users.picture AS users_picture, users.uid AS users_uid' at line 1 query: SELECT COUNT(*) FROM (SELECT DISTINCT(node.nid) AS DISTINCT(node.nid), users.picture AS users_picture, users.uid AS users_uid, users.name AS users_name, node.created AS node_created, node.type AS node_type, node.title AS node_title, node_comment_statistics.comment_count AS node_comment_statistics_comment_count, node.uid AS node_uid, node_revisions.format AS node_revisions_format, DATE_FORMAT((FROM_UNIXTIME(node.created) + INTERVAL 25200 SECOND), '%Y%m%d%H%i') AS node_created_minute FROM node node INNER JOIN users users ON node.uid = users.uid LEFT JOIN node_comment_statistics node_comment_statistics ON node.nid = node_comment_statistics.nid LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid WHERE (node.status <> 0) AND (node.type in ('blog', 'market', 'notes', 'status', 'story')) AND (node.created <= 1219857443+0) ORDER BY node_created_minute DESC ) AS count_alias in D:\...\sites\all\modules\views\includes\view.inc on line 652.
# user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DISTINCT(node.nid), users.picture AS users_picture, users.uid AS users_uid' at line 1 query: SELECT DISTINCT(node.nid) AS DISTINCT(node.nid), users.picture AS users_picture, users.uid AS users_uid, users.name AS users_name, node.created AS node_created, node.type AS node_type, node.title AS node_title, node_comment_statistics.comment_count AS node_comment_statistics_comment_count, node.uid AS node_uid, node_revisions.format AS node_revisions_format, DATE_FORMAT((FROM_UNIXTIME(node.created) + INTERVAL 25200 SECOND), '%Y%m%d%H%i') AS node_created_minute FROM node node INNER JOIN users users ON node.uid = users.uid LEFT JOIN node_comment_statistics node_comment_statistics ON node.nid = node_comment_statistics.nid LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid WHERE (node.status <> 0) AND (node.type in ('blog', 'market', 'notes', 'status', 'story')) AND (node.created <= 1219857443+0) ORDER BY node_created_minute DESC LIMIT 0, 20 in D:\...\sites\all\modules\views\includes\view.inc on line 677.

And all the views node blocks disappeared along with that error. Only when I disabled UR-Node Access module then it goes back to normal. Does anybody have this before? Thanks

Comments

alex.k’s picture

The query Views generates begins with "SELECT DISTINCT(node.nid) AS DISTINCT(node.nid) ...." which doesn't look valid. There should be a label after 'AS' similarly to "users.picture AS users_picture..." - could be that Views doesn't know how to translate "DISTINCT(node.nid)" into a label to put after 'AS'.

What does the query change to when UR_node_access is disabled?

gausarts’s picture

It simply disappeared when UR node Access was disabled. Other possibilities that I might have done with views? but I supposed all is done by just clicking with views. I hardly gave any PHP argument anyway. Thanks

alex.k’s picture

You can see the query views generates when editing the view, in the live preview area. If you post it here, when UR_node_access is disabled, we can compare it with what's in the warning message above.

I would look for a similar report in the Views issue queue, just in case.

gausarts’s picture

As far as I remember the exact same warnings also appeared in views preview. Perhaps I'd better have to duplicate the problem again as soon as possible and report you here. Allow me some time. Thanks for the help.

alex.k’s picture

@gausarts I recall similar issues due to bugs in then-current views release candidates. Could be that the problem is gone with the current Views RC.

gausarts’s picture

Yes, Alex, it does. I have reported at http://drupal.org/node/284392 as well. Hope it'll resolve soon. Thanks.

alex.k’s picture

Status: Active » Postponed (maintainer needs more info)
alex.k’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Please reopen if the patch in #6 did not help. Thanks.

matt2000’s picture

Status: Closed (won't fix) » Closed (fixed)