We recently upgraded to 1.6. Since upgrading, several of our views which use the 'Taxonomy: Terms for (custom type)' filter generate incorrect SQL, e.g.:
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 'IN ('8','2')) ORDER BY node_sticky DESC, node_created_created DESC LIMIT 0, 3' at line 1 query:
SELECT node.nid,
node.sticky AS node_sticky,
node.created AS node_created_created,
node.title AS node_title, node.changed AS node_changed,
users.name AS users_name,
users.uid AS users_uid,
node.created AS node_created,
node_comment_statistics.comment_count AS node_comment_statistics_comment_count
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
WHERE (node.status = '1')
AND (.tid IN ('8','2'))
ORDER BY node_sticky DESC, node_created_created DESC
LIMIT 0, 3
in /var/www/svn/dev/includes/database.mysql.inc on line 172.
The problem is the missing table name in the second clause of the WHERE condition.
We only see this issue sporadically, presumably because the blocks generated by the relevant views are cached for a very long time. I believe there may be some issue with caching, but I do believe there's a bug in views, as the error is always a missing table in the portion of the WHERE clause generated by the 'Taxonomy: Terms for (custom type)' filter.
I see that the SQL error reported in http://drupal.org/node/244644#comment-804515 is the same error that we're seeing. However, I chose to open a new issue, as the original bug in that report is not a SQL error.
Comments
Comment #1
merlinofchaos commentedThis will not be fixed in Views 1.