List:Commits« Previous MessageNext Message »
From:Alexander Barkov Date:April 8 2009 9:15am
Subject:bzr commit into mysql-5.1-bugteam branch (bar:2855) Bug#43827
View as plain text  
#At file:///home/bar/mysql-bzr/mysql-5.1.b43827/ based on revid:satya.bn@stripped

 2855 Alexander Barkov	2009-04-08
      Bug#43827 Server closes connections and restarts
      Problem:
        Crash happened with a user-defined utf8 collation,
        on attempt to insert a value longer than the column
        to store.
      Reason:
        The "ctype" member was not initialized (NULL) when
        allocating a user-defined utf8 collation, so an attempt
        to call my_ctype(cs, *str) to check if we loose any important
        data when truncating the value made the server crash.
      Fix:
        Initializing tge "ctype" member to a proper value.
      
      
      mysql-test/r/ctype_ldml.result
        Adding tests
      
      mysql-test/t/ctype_ldml.test
        Adding tests
      
      strings/ctype-uca.c
        Adding initialization of "ctype" member.

    modified:
      mysql-test/r/ctype_ldml.result
      mysql-test/t/ctype_ldml.test
      strings/ctype-uca.c
=== modified file 'mysql-test/r/ctype_ldml.result'
--- a/mysql-test/r/ctype_ldml.result	2009-02-02 13:25:42 +0000
+++ b/mysql-test/r/ctype_ldml.result	2009-04-08 09:14:09 +0000
@@ -40,6 +40,14 @@ abcd	abcd
 efgh	efgh
 ijkl	ijkl
 DROP TABLE t1;
+#
+# Bug#43827 Server closes connections and restarts
+#
+CREATE TABLE t1 (c1 VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_test_ci);
+INSERT INTO t1 SELECT REPEAT('a',11);
+Warnings:
+Warning	1265	Data truncated for column 'c1' at row 1
+DROP TABLE t1;
 show collation like 'ucs2_vn_ci';
 Collation	Charset	Id	Default	Compiled	Sortlen
 ucs2_vn_ci	ucs2	242			8

=== modified file 'mysql-test/t/ctype_ldml.test'
--- a/mysql-test/t/ctype_ldml.test	2009-02-02 13:25:42 +0000
+++ b/mysql-test/t/ctype_ldml.test	2009-04-08 09:14:09 +0000
@@ -37,6 +37,15 @@ UPDATE t1 SET col2=col1;
 SELECT * FROM t1 WHERE col1=col2 ORDER BY col1;
 DROP TABLE t1;
 
+--echo #
+--echo # Bug#43827 Server closes connections and restarts
+--echo #
+# Crash happened with a user-defined utf8 collation,
+# on attempt to insert a string longer than the column can store.
+CREATE TABLE t1 (c1 VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_test_ci);
+INSERT INTO t1 SELECT REPEAT('a',11);
+DROP TABLE t1;
+
 #
 #  Vietnamese experimental collation
 #

=== modified file 'strings/ctype-uca.c'
--- a/strings/ctype-uca.c	2007-07-03 09:06:57 +0000
+++ b/strings/ctype-uca.c	2009-04-08 09:14:09 +0000
@@ -7992,6 +7992,7 @@ static my_bool create_tailoring(CHARSET_
 static my_bool my_coll_init_uca(CHARSET_INFO *cs, void *(*alloc)(size_t))
 {
   cs->pad_char= ' ';
+  cs->ctype= my_charset_utf8_unicode_ci.ctype;
   return create_tailoring(cs, alloc);
 }
 


Attachment: [text/bzr-bundle] bzr/bar@mysql.com-20090408091409-i6ozfx5s6eftwt3a.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (bar:2855) Bug#43827Alexander Barkov8 Apr