Closed (duplicate)
Project:
Views (for Drupal 7)
Version:
5.x-1.6
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
9 Nov 2007 at 21:44 UTC
Updated:
14 Nov 2007 at 23:34 UTC
Hello,
I've been using views for awhile now, and it's been great. Recently a strange error or bug cropped up and I was hoping I might get some assistance.
Essentially all the views I create that have an exposed filter to search for the node title give me a SQL error only when the search term begins with a lower-case 'b'.
It appears that for some reason the lower-case b is getting translated to 'node' for some reason in the SQL statement.
Here's the error when searching for 'b':
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 'node'%')) AND (node_data_field_user_class.field_user_class_value IN ('Faculty','' at line 1 query: SELECT count( DISTINCT(node.nid)) FROM node node LEFT JOIN content_type_inventory_control_form node_data_field_full_name ON node.vid = node_data_field_full_name.vid LEFT JOIN content_type_inventory_control_form node_data_field_user_class ON node.vid = node_data_field_user_class.vid LEFT JOIN content_type_inventory_control_form node_data_field_building ON node.vid = node_data_field_building.vid LEFT JOIN content_type_inventory_control_form node_data_field_room_number ON node.vid = node_data_field_room_number.vid LEFT JOIN content_type_inventory_control_form node_data_field_dell_service_tag ON node.vid = node_data_field_dell_service_tag.vid INNER JOIN users users ON node.uid = users.uid WHERE (node.type IN ('inventory_control_form')) A
Here's an example if I use other letters after the lower-case 'b', for the word 'below':
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 'node'elow%')) AND (node_data_field_user_class.field_user_class_value IN ('Facult' at line 1 query: SELECT count( DISTINCT(node.nid)) FROM node node LEFT JOIN content_type_inventory_control_form node_data_field_full_name ON node.vid = node_data_field_full_name.vid LEFT JOIN content_type_inventory_control_form node_data_field_user_class ON node.vid = node_data_field_user_class.vid LEFT JOIN content_type_inventory_control_form node_data_field_building ON node.vid = node_data_field_building.vid LEFT JOIN content_type_inventory_control_form node_data_field_room_number ON node.vid = node_data_field_room_number.vid LEFT JOIN content_type_inventory_control_form node_data_field_dell_service_tag ON node.vid = node_data_field_dell_service_tag.vid INNER JOIN users users ON node.uid = users.uid WHERE (node.type IN ('inventory_control_form')) AND (UPPER(
As you may notice, the error:
right syntax to use near 'node'elow%')
Seems to indicate 'b' -> 'node' for some strange reason.
Regards,
Eric
Comments
Comment #1
ecarter commentedAfter looking through the issues, I noticed someone posted the solution. See http://drupal.org/node/165611 for more information.
Eric