SQL Bug?

Openlogic - July 25, 2007 - 17:20
Project:Directory
Version:6.x-1.0-alpha1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

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

#1

beginner - July 26, 2007 - 05:49

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.

#2

Openlogic - July 27, 2007 - 00:45

Sorry I should have specified.

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

Thanks

#3

beginner - July 16, 2008 - 07:01
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

#4

Anonymous (not verified) - July 31, 2008 - 04:46
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.