Closed (outdated)
Project:
Unique field
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Nov 2008 at 22:29 UTC
Updated:
18 Apr 2024 at 08:56 UTC
Jump to comment: Most recent
Comments
Comment #1
arithmetric commentedHi ascetic,
Thanks for reporting this issue.
My intention is that this module does case-insensitive comparisons by default, so that 'Siddhartha' and 'siddhartha' are considered duplicate values. This is how the module works for me.
However, whether the comparison is case-sensitive or not may depend on your database software and configuration. For example, MySQL performs this comparison without case-sensitivity only since version 4.0. What database are you using?
In a future version I'd like to make this behavior explicit and provide the option to use case-sensitive comparisons if preferred.
Comment #2
cspitzlayHi detour,
the question of case sensitivity in MySQL is even more complex because it does not only depend on the version (I guess a minimum version is required) but also on the collation setting of the column in question.
Collations can also implement specific rules to accomodate requirements from different languages:
* the characters that correspond to each other (upper/lower case); IIRC in Turkish the uppercase character of "i" is not "I" but a separate character.
* other rules like "ü" == "y" (Swedish rule) or "ß" == "ss" (German rule); and what's worse, the latter one has even changed between MySQL 5.0 and 5.1 (for collation utf8_general_ci).
In an ideal world the check done in the module would always be identical to the check done by the underlying MySQL column that gets to store the value. But I'm not sure how this could be achieved.
Comment #3
BenK commentedKeeping track of this thread...
Comment #4
Matthew Davidson commentedThe patch here might do the job for you. I'd really appreciate as many testers as possible, but it's a pretty major overhaul of how Unique Field works, so use with caution in production.
Comment #5
mtcs commentedThis is strange. I have the opposite problem.
Node title comparison is not case sensitive in my Drupal setup. To make things worse characters with accents are treated as equal to the pairs without accents (e.g. é=e, ő=o, etc.), which is clearly wrong.
The problem is caused by MySQL case sensitivity in string searches that depends on the type of the string column.
The solution is to use the BINARY Operator:
$qwhere = "BINARY node.title = '". db_escape_string($values) ."' ";I've created a new issue for the problem of accented characters: #1306276: Wrong comparison of accented characters in strings
Comment #6
astonvictor commentedI'm closing it because the issue was created a long time ago without any further steps.
if you still need it then raise a new one.
thanks