sql problem with views and usernode

Lausch - August 2, 2007 - 15:30
Project:Usernode
Version:5.x-1.4
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

hi guys

i tryd to find different things of different profile fields

now the serious problem

if i search for "user wants" = business

userlist?filter6=business

i get the following error:

    * 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'usiness%'))' at line 1 query: SELECT count( DISTINCT(node.nid)) FROM node node INNER JOIN usernode usernode ON node.nid = usernode.nid LEFT JOIN users usernode_users ON usernode.uid = usernode_users.uid INNER JOIN users users ON node.uid = users.uid LEFT JOIN profile_values b_wants ON users.uid = b_wants.uid AND b_wants.fid = '12' WHERE (node.type IN ('usernode')) AND (usernode_users.status = '1') AND (UPPER(b_wants.value) LIKE UPPER(''node'usiness%')) in C:\BETA\htdocs\invest\includes\database.mysqli.inc on line 151.
    * 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'usiness%')) LIMIT 0, 5' at line 1 query: SELECT DISTINCT(node.nid) FROM node node INNER JOIN usernode usernode ON node.nid = usernode.nid LEFT JOIN users usernode_users ON usernode.uid = usernode_users.uid INNER JOIN users users ON node.uid = users.uid LEFT JOIN profile_values b_wants ON users.uid = b_wants.uid AND b_wants.fid = '12' WHERE (node.type IN ('usernode')) AND (usernode_users.status = '1') AND (UPPER(b_wants.value) LIKE UPPER(''node'usiness%')) LIMIT 0, 5 in C:\BETA\htdocs\invest\includes\database.mysqli.inc on line 151.

"(''node'usiness%"

seems like the module eat the "b" ?

if i search for zbusiness

userlist?filter6=zbusiness

there is no error.

what should i do?

my serverbanner:

Apache/2.2.4 (Win32) DAV/2 mod_ssl/2.2.4 OpenSSL/0.9.8e mod_autoindex_color PHP/5.2.2 Server at localhost Port 80

and i use windows xp sp2 with xampp and drupal 5.2

greets

Lausch

uh i remember... some days ago i got a simmilar problem with attachment description if i type "this song is cool"

i get the output "this song is c"

wtf?

#1

Lausch - August 2, 2007 - 15:43

i tryd some now...

this error will only show if i use the exposed filter for "included all of the words" with search parameter "b"

i tryd a-z and only "b" brings the error

greets

Lausch

#2

paul2 - February 7, 2009 - 06:37
Version:5.x-1.x-dev» 5.x-1.4
Component:Miscellaneous» Code

I'd just like to point out that I'm receiving this problem as well. I also have an exposed filter on a Profile field, and if in the view I try to filter the list by entering a string beginning with a lowercase "b", I get this same MySQL error.

Very strange...

#3

paul2 - February 7, 2009 - 06:47

Hmm. Just discovered a couple more things:

  • This applies to exposed filters on any Profile textfield as well as the "Usernode: E-mail" field
  • Filtering a field by a string starting with "s" doesn't match properly - it apparently doesn't match anything. But filtering by a string starting with capital "S" matches fine.

Clearly something isn't getting escaped properly. "%b" and "%s" must have special meanings somewhere along the way to forming the SQL query. Would this be a Usernode issue or Views issue...? I haven't been able to make head or tail of the Views code to be able to know...

#4

paul2 - February 7, 2009 - 07:09
Status:active» closed

Looks like it's a Views issue: http://drupal.org/node/165611

 
 

Drupal is a registered trademark of Dries Buytaert.