MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Alexander Nozdrin Date:December 15 2009 8:20pm
Subject:bzr commit into mysql-5.5-trunk-bugfixing branch (alik:2916) Bug#47756
View as plain text  
#At file:///mnt/raid/alik/MySQL/bzr/backporting/mysql-trunk-bugfixing/ based on revid:alik@stripped

 2916 Alexander Nozdrin	2009-12-15
      Backporting patch for Bug#47756
      from mysql-next-mr-bugfixing into mysql-trunk-bugfixing.
      
      NOTE: the "utf8_phone_ci" collation does not exist in mysql-trunk yet,
      so another collation with 2-byte collation ID is used: "utf8_test_ci".
      
      This patch will be null-merged to mysql-next-mr-bugfixing.
      
      Original revision:
      ------------------------------------------------------------
      revision-id: bar@stripped
      committer: Alexander Barkov <bar@stripped>
      branch nick: mysql-next-mr.b47756
      timestamp: Mon 2009-12-07 16:11:53 +0400
      message:
        Bug#47756 Setting 2byte collation ID with 'set names' crashes the server
        
        The problem is not actually related to 2byte collation IDs.
        The same crash happens if you change the collation ID in
        mysql-test/str_data/Index.xml to a value smaller than 256.
        
        Crash happened in SQL parser, because the "ident_map" and "state_map"
        arrays were not initialized in loadable utf8 collations.
        
        Fix: adding proper initialization of the "ident_map" and "state_map"
        members for loadable utf8 collations.
      ------------------------------------------------------------

    modified:
      mysql-test/r/ctype_ldml.result
      mysql-test/t/ctype_ldml.test
      mysys/charset.c
=== modified file 'mysql-test/r/ctype_ldml.result'
--- a/mysql-test/r/ctype_ldml.result	2009-11-06 14:20:27 +0000
+++ b/mysql-test/r/ctype_ldml.result	2009-12-15 20:20:53 +0000
@@ -369,3 +369,8 @@ s1
 a
 b
 DROP TABLE t1;
+SET NAMES utf8 COLLATE utf8_test_ci;
+SHOW COLLATION LIKE 'utf8_test_ci';
+Collation	Charset	Id	Default	Compiled	Sortlen
+utf8_test_ci	utf8	353			8
+SET NAMES utf8;

=== modified file 'mysql-test/t/ctype_ldml.test'
--- a/mysql-test/t/ctype_ldml.test	2009-11-06 14:20:27 +0000
+++ b/mysql-test/t/ctype_ldml.test	2009-12-15 20:20:53 +0000
@@ -125,3 +125,11 @@ CREATE TABLE t1 (s1 char(10) character s
 INSERT INTO t1 VALUES ('a'),('b');
 SELECT * FROM t1 WHERE s1='a' ORDER BY BINARY s1;
 DROP TABLE t1;
+
+
+#
+# Bug#47756 Setting 2byte collation ID with 'set names' crashes the server
+#
+SET NAMES utf8 COLLATE utf8_test_ci;
+SHOW COLLATION LIKE 'utf8_test_ci';
+SET NAMES utf8;

=== modified file 'mysys/charset.c'
--- a/mysys/charset.c	2009-10-15 10:17:32 +0000
+++ b/mysys/charset.c	2009-12-15 20:20:53 +0000
@@ -255,6 +255,9 @@ static int add_collation(CHARSET_INFO *c
       {
 #if defined (HAVE_CHARSET_utf8) && defined(HAVE_UCA_COLLATIONS)
         copy_uca_collation(newcs, &my_charset_utf8_unicode_ci);
+        newcs->ctype= my_charset_utf8_unicode_ci.ctype;
+        if (init_state_maps(newcs))
+          return MY_XML_ERROR;
 #endif
       }
       else


Attachment: [text/bzr-bundle] bzr/alik@sun.com-20091215202053-3uyr9gee2fsfguji.bundle
Thread
bzr commit into mysql-5.5-trunk-bugfixing branch (alik:2916) Bug#47756Alexander Nozdrin15 Dec