Hi!
On Mar 05, Rikard Bogren wrote:
> I have a problem with index on a UTF-8 based db/table and mySQL 4.1 (I have
> tried 5.0 too).
> I run the mysqld with the --default-character-set=utf8 flag and I'm
> certain that it's UTF-8 data that I'm putting into the database.
> To reproduce, follow these simple steps.
>
> #-----------------------------------
> CREATE DATABASE `database` DEFAULT CHARACTER SET utf8;
>
> CREATE TABLE `table` (
> `id` VARCHAR( 10 ) NOT NULL ,
> `name` VARCHAR( 10 ) NOT NULL
> ) CHARACTER SET = utf8;
>
> ALTER TABLE `table` ADD INDEX ( `name` )
>
> INSERT INTO `table` ( `id` , `name` )
> VALUES (
> '1', 'Rene'
> );
>
> INSERT INTO `table` ( `id` , `name` )
> VALUES (
> '2', 'Ren?'
Don't mind question mark, I know what was there and I used the proper
character what I tested it :)
> );
>
>
> # Now make some queries...
>
>
> SELECT *
> FROM `table`
> WHERE `name` = 'Rene';
>
> SELECT *
> FROM `table`
> WHERE `name` = 'Ren?';
>
> # These previous two lines work equally, which I reckon is wrong.
This is how utf8_general_ci collation in MySQL is defined.
In 4.1.2 or 4.1.3 we'll support more unicode collations,
so you'll be able to chose how accents should be treated.
> SELECT *
> FROM `table`
> WHERE `name` LIKE 'Rene';
>
> # Seems to work correctly.
>
> SELECT *
> FROM `table`
> WHERE `name` LIKE 'Ren?';
>
> # This previous line gives no result, and I've understood it is because of
> how "Rene" and "Ren?" are somehow treated as equal.
Works for me - returns 'Ren?'
Apparently it's fixed already in 4.1.2 (to be out soon)
Regards,
Sergei
--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik <[EMAIL PROTECTED]>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Senior Software Developer
/_/ /_/\_, /___/\___\_\___/ Osnabrueck, Germany
<___/ www.mysql.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]