Closed (duplicate)
Project:
Views (for Drupal 7)
Version:
5.x-1.6
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Jul 2007 at 00:17 UTC
Updated:
4 Oct 2007 at 23:18 UTC
I've been helping with a site that is using CCK and Views. The users, as many users are wont to be, aren't terribly careful about proper word case. When I expose a filter ("contains") and have them enter, for example, "foo" it is not finding nodes with "Foo" in them and vice versa. Is this the way it is supposed to be? I hope not.
Comments
Comment #1
nancydru??
Comment #2
merlinofchaos commentedYes, database searches are case sensitive by default. It causes additional load to convert everything to upper/lower case prior to matching, and these searches are pretty slow as it is.
You can write additional filters to get non case sensitive searches, but this isn't a bug. At best it's a feature request.
Comment #3
mooffie commented>
> Yes, database searches are case sensitive by default.
Are you sure?
CCK uses the 'views_handler_filter_like' operator for its string filter. And this function, which resides in 'views.module', wraps every string in the SQL with 'UPPER()'.
Here's a snippet from the function:
Nancy, the same code, and therefore the same SQL, is used for filtering by node title. Does filtering by node title is case sensitive too, on your system?
(Is it possible your DB uses the 'utf8_bin' collate?)
Comment #4
nancydruThis is not my site; I'm just helping. But yes, I am sure this is happening. I don't filter on title, so I can't say whether it's doing it on the title.
Collation:
collation_connection utf8_general_ci
collation_database latin1_swedish_ci
collation_server latin1_swedish_ci
php: 4.3.11
MySql: 4.1.21
Comment #5
mooffie commentedWell, I can only suggest two things:
1. Do
SHOW FULL COLUMNS FROM table-name;and verify that you see 'utf8' in the collation column. (If you're using phpMyAdmin, this info is in each table overview screen.)2. Do
SELECT UPPER(column-name) FROM table-name;and see if there's something strange there. That is, if there are lowercase letters that got converted wrong.Comment #6
rocknet commentedIt is my site that Nancy has been working on and this filter problem has appeared. The strange thing is that two of the filters work fine for lower case and upper case. They return a positive match regardless of what case the first letter is. Just what I would expect.
However, the third and subsequent filters do not work as expected. They are case sensitive which will cause confusion for my users, who can't be expected to know that they should start their search terms with an upper case letter.
These symptoms would indicate that the system is capable of working, but does not.
Comment #7
mooffie commentedIt would be helpful to see the SQL query that is generated. The 'devel' module lets you see all the queries sent to MySQL. Please install it and paste here the query.
Comment #8
merlinofchaos commentedIt may be that an individual filter is case sensitive; you must tell us which filters you're actually using.
Comment #9
mark matuschka commentedI had the same problem.
Fixed by patch at http://drupal.org/node/165611.