Bug #31615 crash after set names ucs2 collate xxx
Submitted: 15 Oct 2007 17:33 Modified: 18 Dec 2007 22:05
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Charsets Severity:S1 (Critical)
Version:5.1.23, .5.0.50, 4.1 OS:Any
Assigned to: Ramil Kalimullin CPU Architecture:Any
Tags: bfsm_2007_10_18, crash, ucs2

[15 Oct 2007 17:33] Shane Bester
Description:
0x820147b handle_segfault + 541
0x820e053 alloc_query(THD*, char const*, unsigned int) + 31
0x820ceb2 dispatch_command(enum_server_command, THD*, char*, unsigned int) + 2180
0x820c622 do_command(THD*) + 600
0x820b01d handle_one_connection + 255
0x40038aa7 _end + 931809239
0x4017ec2e _end + 933144926

How to repeat:
set names ucs2 collate ucs2_romanian_ci;
select 'a';

Suggested fix:
related to bug #28832 (SET character_set_client = ucs2 is exected, but server doesn't parse UCS2) ?
[15 Oct 2007 17:36] Paul DuBois
ucs2 cannot be used for SET NAMES (http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html), but presumably trying to do so shouldn't cause a crash.
[15 Oct 2007 17:42] MySQL Verification Team
most collations crash.  either it should be handled correctly or rejected.

set names ucs2 collate  ucs2_bin;select 'a';
set names ucs2 collate  ucs2_unicode_ci;select 'a';
set names ucs2 collate  ucs2_icelandic_ci;select 'a';
set names ucs2 collate  ucs2_latvian_ci;select 'a';
set names ucs2 collate  ucs2_romanian_ci;select 'a';
set names ucs2 collate  ucs2_slovenian_ci;select 'a';
set names ucs2 collate  ucs2_polish_ci;select 'a';
set names ucs2 collate  ucs2_estonian_ci;select 'a';
set names ucs2 collate  ucs2_spanish_ci;select 'a';
set names ucs2 collate  ucs2_swedish_ci;select 'a';
set names ucs2 collate  ucs2_turkish_ci;select 'a';
set names ucs2 collate  ucs2_czech_ci;select 'a';
set names ucs2 collate  ucs2_danish_ci;select 'a';
set names ucs2 collate  ucs2_lithuanian_ci;select 'a';
set names ucs2 collate  ucs2_slovak_ci;select 'a';
set names ucs2 collate  ucs2_spanish2_ci;select 'a';
set names ucs2 collate  ucs2_roman_ci;select 'a';
set names ucs2 collate  ucs2_persian_ci;select 'a';
set names ucs2 collate  ucs2_esperanto_ci;select 'a';
set names ucs2 collate  ucs2_hungarian_ci;select 'a';
[17 Oct 2007 9:28] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/35740

ChangeSet@1.2689, 2007-10-17 14:28:00+05:00, ramil@mysql.com +4 -0
  Fix for bug#31615: crash after set names ucs2 collate xxx
  
  Problem: currently, UCS-2 cannot be used as a client character set.
  
  Fix: raise an error if one attempts to set it to USC-2.
[17 Oct 2007 13:16] Sergey Vojtovich
Ok to push.
[22 Oct 2007 6:27] MySQL Verification Team
I didn't notice that there was a similar Bug #29562 (default collation of ucs2_unicode_ci crashes slave)
[23 Oct 2007 10:46] Alexander Barkov
http://lists.mysql.com/commits/35740 is ok to push
[6 Dec 2007 7:49] Alexander Barkov
"Bug#32387 Character sets: crash if set names utf32"
is most likely a duplicate for this one.
Waiting for the patch to propagate to 6.0.
[7 Dec 2007 23:07] Bugs System
Pushed into 6.0.5-alpha
[7 Dec 2007 23:09] Bugs System
Pushed into 5.1.23-rc
[7 Dec 2007 23:10] Bugs System
Pushed into 5.0.54
[7 Dec 2007 23:10] Bugs System
Pushed into 4.1.24
[18 Dec 2007 22:05] Paul DuBois
Noted in 4.1.24, 5.0.54, 5.1.23, 6.0.5 changelogs.

ucs2 does not work as a client character set, but attempts to use it
as such were not rejected. Now character_set_client cannot be set to
ucs2. This also affects statements such as SET NAMES and SET
CHARACTER SET.
[25 May 2010 16:21] Paul DuBois
Bug#33221 was marked as a duplicate of this bug.
[7 Nov 2010 16:42] MySQL Verification Team
related: bug #58036