Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When editing a node (any node) the following error message is presented:
You have an error in your SQL syntax near 'USING(type_name, group_name) JOIN node_field_instance fi USING(field_name, type_' at line 1 query: SELECT fi.*, g.group_name FROM node_group g JOIN node_group_fields f USING(type_name, group_name) JOIN node_field_instance fi USING(field_name, type_name) ORDER BY fi.weight in <my path>/includes/database.mysql.inc on line 167.
I have tracked this down to fieldgroup_groups() in fieldgroup.module. It seems my version of MySQL does not like the following:
$result = db_query("SELECT fi.*, g.group_name FROM {node_group} g ".
"JOIN {node_group_fields} f USING(type_name, group_name) ".
"JOIN {node_field_instance} fi USING(field_name, type_name) ".
"ORDER BY fi.weight");
I have seen this before - in date.module a couple of days ago. It seems that MySQL doesn't like the JOIN's (not sure why yet) looks like you have to give it an INNER or OUTER.
I am using MySQL v3.23.56.
Comment | File | Size | Author |
---|---|---|---|
#5 | fieldgroup.patch | 1.12 KB | RobRoy |
Comments
Comment #1
RobRoy CreditAttribution: RobRoy commentedIIRC MySQL 3 can't use USING. For posterity we should just explicitly list the joins. Can't patch now, maybe later.
Comment #2
RobRoy CreditAttribution: RobRoy commentedOh, and explicitly specify the INNER JOIN.
Comment #3
kmv CreditAttribution: kmv commentedI don't know about all of v3, but v3.23.x does support USING.
I can confirm that explicitly specifying INNER JOIN does fix the problem. Thanks.
Comment #4
RobRoy CreditAttribution: RobRoy commentedYeah, I did a little more digging and you're right. It's the JOIN that's a problem.
I think we should scrap USING anyways as it's not really used in any other code and it may make fieldgroup more SQL-compliant.
Comment #5
RobRoy CreditAttribution: RobRoy commentedHere's a patch.
Comment #6
KarenS CreditAttribution: KarenS commentedFixed. Forgot to give you credit in the commit for the patch though. Sorry!
Comment #7
(not verified) CreditAttribution: commented