List:Internals« Previous MessageNext Message »
From:Alexander Barkov Date:December 7 2005 4:02pm
Subject:Re: UTF8 Ukrainian collation
View as plain text  
Hello Mike,

ALTER DATABASE changes only the default collation, which
will be used in the further CREATE TABLE. It doesn't touch
the existing tables.

You have to alter your tables, for example:


ALTER TABLE t1
   MODIFY col1 VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci;


Or you can just run "mysqldump", then fix the dump file changeing
"utf8_general_ci" to "utf8_unicode_ci" and then fed it back using
"mysql".


Best regards!

Mike Futerko wrote:
> Hello Alexander,
> 
>>> Not sure it's the right list, but...
>>>
>>> I noticed that MySQL (checked with versions 4.1.14, 5.0.16) sorts 
>>> Ukrainian letters in a wrong order in UTF8 charset, while other 
>>> Cyrillic charsets (koi8u, cp1251) works well.
>>>
>>> The question is: what is the right way to fix the problem?
>>>
>>> Should I add new collation "utf8_ukrainian_ci" like there are for 
>>> Polish, Swedish, Turkish etc languages or just fix some UTF8 code table?
>>>
>>> Note that other Cyrillic characters are sorted well, except only 
>>> Ukrainian.
>>>
>>> Any hints/help would be appreciated.
>>
>>
>>
>> Unfortunately that's true, Ukranian letters are not sorted well in
>> utf8_general_ci. However, there is no a need to add a separate collation
>> for Ukranian. Please try utf8_unicode_ci. It sorts the Ukranian letters
>> correctly.
> 
> 
> Thanks for the help, but it doesn't work for me. I did the following:
> 1) ALTER DATABASE ... COLLATE utf8_unicode_ci;
> 2) SELECT ... ORDER BY ...;
> 
> And Ukrainian letter "I" shown before "A" :(
> 
> Regards,
> Mike.
> 
Thread
UTF8 Ukrainian collationMike Futerko2 Dec
  • Re: UTF8 Ukrainian collationSanja Byelkin5 Dec
  • Re: UTF8 Ukrainian collationAlexander Barkov7 Dec
    • Re: UTF8 Ukrainian collationMike Futerko7 Dec
      • Re: UTF8 Ukrainian collationAlexander Barkov7 Dec
        • Re: UTF8 Ukrainian collationMike Futerko7 Dec
          • Re: UTF8 Ukrainian collationAlexander Barkov8 Dec