I have a users table in which there's a column called 'nickname', utf-8 encoded, varchar(20), the table is in InnoDB. There're 2 records one has a nickname = 'gunni' and the other nickname = 'günni'. When I tried to apply a unique index onto this column, mysql gave me this error :
ERROR 1062 (23000) at line 263: Duplicate entry 'gunni' for key 2
I checked the data there's only one record that has the name 'gunni', and if I change the 'günni' record to something else then apply the unique index again, everything works fine.
How come 'günni' & 'gunni' be duplicates? Here is the hex values for them, I get this with mysql's hex() function :
gunni -> 67756E6E69
günni -> 67C3BC6E6E69
They're obviously different. How come mysql treats these 2 as the same? Or is there something I don't know about unique indexes? Or even, could this be a mysql bug?
Thanks.