With a little research today I discovered that it is possible to do a
case insensitive match on a binary column by using COLLATE. This may
not be helpful for the current issue, but here is an example:
CREATE TABLE `unique_test` (
`name` varchar(32) binary,
UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO `unique_test` (name) VALUES ('Test'), ('test');
SELECT * FROM unique_test;
+------+
| name |
+------+
| Test |
| test |
+------+
2 rows in set (0.00 sec)
SELECT * FROM unique_test WHERE name LIKE 'Test';
+------+
| name |
+------+
| Test |
+------+
1 row in set (0.00 sec)
-- assuming the table was created as utf8
-- set charset for current connection to utf8 (only necessary if utf8
is not the MySQL server default)
SET character_set_connection = 'utf8';
-- force case insensitive match on a binary case sensitive field
SELECT * FROM unique_test WHERE name LIKE 'Test' COLLATE
utf8_general_ci;
+------+
| name |
+------+
| Test |
| test |
+------+
2 rows in set (0.00 sec)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---