I'm new here, so pl. let me know if I'm doing something wrong.

I'd been seeing a recurring SQL SELECT error message every time I updated the directory settings. Also noticed that the node counts were not displaying.

I traced it to the function and the SQL queries:

        $result = db_query(db_rewrite_sql('SELECT t.tid, n.nid FROM {term_node} t JOIN {node} n ON t.nid = n.nid WHERE n.status = 1', 't', 'tid'));
  

which I changed to:

        $result = db_query(db_rewrite_sql('SELECT t.tid, n.nid FROM {term_node} t LEFT JOIN {node} n ON t.nid = n.nid WHERE n.status = 1', 't', 'tid'));
  

essentially adding the LEFT keyword to JOIN.

I tried this first with the official release version and then with the dev version with identical results.

Was this an oversight, incorrect code version or a real bug?

Thanks

Comments

beginner’s picture

Hello fsiddiqi, thanks for the report.

Since it is a SQL error, it would be appropriate to give the SQL engine (mysql?) and version that you are using.
Also, can you copy the exact error message that you get?

Thank you for providing a solution, too.

Openlogic’s picture

Sorry I should have specified.

This problem occurred for me on MySQL 3.23 and was reported as a SQL syntax error.

Thanks

beginner’s picture

Version: 5.x-1.x-dev » 6.x-1.0-alpha1
Status: Active » Fixed

MySQL 3.x is no longer supported by Drupal.

See the new D6 alpha release announcement:
http://drupal.org/node/283259

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.