Hi,

I am running 4.5.1 and upgraded to the CVS version of taxomony_access complete with patches to taxonomy.module.

After some initial problems which were related to not cleaning out the tables node_access and term_access all seems to be functioning correctly, however everytime there is a change to the category permissions I get the following single entry in the log:

user error: 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 'SELECT nid from term_node)' at line 1 query: SELECT nid FROM node WHERE nid not IN (SELECT nid from term_node) in /home/james/public_html/drupal/includes/database.mysql.inc on line 125.

Assuming a version missmatch issue I upgraded database.inc and database.mysql.inc to cvs however this turned out to be unworkable so I reverted. As stated, everything appears to be fine except for the offending log entry.

Comments

pyromanfo’s picture

What version of Mysql are you running? I'm running 4.1.7 and I'm not getting any errors

javanaut’s picture

Mysql 4.0.x and greater support subselects, which appear to be in use here. Mysql 3.23.x doesn't support that. You can restructure your SQL query to use the LEFT JOIN syntax to be more compatible.

Just guessing, I would say changing this:

SELECT nid FROM node WHERE nid not IN (SELECT nid from term_node)

to something like this:

SELECT nid FROM node n LEFT JOIN term_node t ON t.nid=n.nid WHERE t.nid IS NULL
pyromanfo’s picture

Okay, it's in CVS. Thanks.

jnt’s picture

Yes, the fix has worked, no more log entries appear to be occuring. Thanks all.
For the record on problem scope however, the version of MySQL I am running on which the error was occuring was/is 4.0.22.

Perhaps there is an MySQL flag set?

Anyway, thanks again to both of you.

javanaut’s picture

Actually referring to the website, it appears that I was wrong. Version 4.1 and greater support subselects, not versions 4.0.x.

http://dev.mysql.com/doc/mysql/en/Subqueries.html

Additionally, the NOT IN syntax generally requires a full table scan, as all records have to be explicitely checked. Though the syntax is lovely, the performance suffers. If there is a way around it, I would avoid it.

Steve Dondley’s picture

Has this been fixed for 4.5.1? I'm getting errors on 4.5.1.

Steve Dondley’s picture

Never mind. I see it has been fixed on 4.5.1

Anonymous’s picture