Great Module. It seems like it's working great, but I keep finding this in my error log:

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(n.nid),n.uid FROM node n INNER JOIN node_access na ON na.nid = n.nid ' at line 1 query: SELECT n.title, DISTINCT(n.nid),n.uid FROM node n INNER JOIN node_access na ON na.nid = n.nid LEFT JOIN drigg_node dn2 ON dn2.dnid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'tac_lite') OR (na.gid = 39 AND na.realm = 'tac_lite') OR (na.gid = 40 AND na.realm = 'tac_lite') OR (na.gid = 41 AND na.realm = 'tac_lite') OR (na.gid = 32 AND na.realm = 'tac_lite') OR (na.gid = 35 AND na.realm = 'tac_lite') OR (na.gid = 44 AND na.realm = 'tac_lite') OR (na.gid = 39 AND na.realm = 'tac_lite') OR (na.gid = 40 AND na.realm = 'tac_lite') OR (na.gid = 41 AND na.realm = 'tac_lite') OR (na.gid = 32 AND na.realm = 'tac_lite') OR (na.gid = 35 AND na.realm = 'tac_lite') OR (na.gid = 44 AND na.realm = 'tac_lite'))) AND ( 1=1 AND !(n.type='drigg' AND dn2.killed=1 ) ) AND ( !(n.type='drigg' AND n.created > UNIX_TIMESTAMP(CURRENT_TIMESTAMP()) ) ) AND ( n.type='drigg' AND n.created > UNIX_TIMESTAMP(CURRENT_TIMESTAMP()) - 60*1440 AND n.created < UNIX_TIMESTAMP(CURRENT_TIMESTAMP()) - 60*60 AND n.status = 1 and n.promote=0 AND n.nid NOT IN (select nid from votingapi_vote where content_type='node' AND content_id=n.nid AND uid IN (55,56,57) AND n.uid <> uid ) ) GROUP BY n.nid in /home/site_name/public_html/includes/database.mysql.inc on line 172.

Comments

Dave Cohen’s picture

Status: Active » Postponed (maintainer needs more info)

Why do you think tac_lite is responsible? Could be drigg or some other module.

taqwa’s picture

We recently installed TAC lite and have been using Drigg for a long time without seeing this error.

Dave Cohen’s picture

I can't say for sure, but I suspect drigg or some other module is responsible for that SQL query. Drupal re-writes the query to include the node_access clauses. You happen to be using tac_lite, but you'd have the problem with any node access module.

Solving might be as simple as re-ordering the select so that n.nid comes first, before n.title. I think the "DISTINCT" is being added during sql rewrite.

Just because you enable tac_late after the other module doesn't mean tac_lite is the cause of the problem.

mrfelton’s picture

I have a similar error:

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), node.title AS node_title, node.vid AS node_vid, nod' at line 1 query: SELECT DISTINCT(node.nid) AS DISTINCT(node.nid), node.title AS node_title, node.vid AS node_vid, node_data_field_video_pdf.field_video_pdf_fid AS node_data_field_video_pdf_field_video_pdf_fid, node_data_field_video_pdf.field_video_pdf_list AS node_data_field_video_pdf_field_video_pdf_list, node_data_field_video_pdf.field_video_pdf_data AS node_data_field_video_pdf_field_video_pdf_data, node.type AS node_type, flag_content.content_id AS flag_content_content_id FROM node node LEFT JOIN flag_content flag_content_node ON node.nid = flag_content_node.content_id AND flag_content_node.fid = 2 LEFT JOIN content_type_video node_data_field_video_pdf ON node.vid = node_data_field_video_pdf.vid LEFT JOIN flag_content flag_content ON node.nid = flag_content.content_id AND (flag_content.fid = 2 AND flag_content.uid = 0) INNER JOIN node_access na ON na.nid = node.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'tac_lite'))) AND ( (node.status <> 0) AND (node.type in ('video')) AND (node.language in ('en', '')) AND (node.vid IN ( SELECT tn.vid FROM term_node tn LEFT JOIN term_hierarchy th ON th.tid = tn.tid LEFT JOIN term_hierarchy th1 ON th.parent = th1.tid LEFT JOIN term_hierarchy th2 ON th1.parent = th2.tid LEFT JOIN term_hierarchy th3 ON th2.parent = th3.tid LEFT JOIN term_hierarchy th4 ON th3.parent = th4.tid LEFT JOIN term_hierarchy th5 ON th4.parent = th5.tid LEFT JOIN term_hierarchy th6 ON th5.parent = th6.tid LEFT JOIN term_hierarchy th7 ON th6.parent = th7.tid LEFT JOIN term_hierarchy th8 ON th7.parent = th8.tid LEFT JOIN term_hierarchy th9 ON th8.parent = th9.tid LEFT JOIN term_hierarchy th10 ON th9.parent = th10.tid WHERE tn.tid = 55 OR th1.tid = 55 OR th2.tid = 55 OR th3.tid = 55 OR th4.tid = 55 OR th5.tid = 55 OR th6.tid = 55 OR th7.tid = 55 OR th8.tid = 55 OR th9.tid = 55 OR th10.tid = 55 )) ) in /home/tom/workspace/all.6/modules/views/includes/view.inc on line 759.

EDIT: Sorry. My issue is with Drupal 6

mrfelton’s picture

My issue was caused by the use of the DISTINCT filter in Views.

tinker’s picture

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

5.x version no longer supported.