List:Commits« Previous MessageNext Message »
From:Alexander Barkov Date:December 15 2010 10:32am
Subject:bzr commit into mysql-trunk-bugfixing branch (bar:3436)
View as plain text  
#At file:///home/bar/mysql-bzr/mysql-trunk-bugfixing/ based on revid:luis.soares@stripped

 3436 Alexander Barkov	2010-12-15 [merge]
      Merging from 5.5-bugteam

    modified:
      mysql-test/r/ctype_many.result
      mysql-test/t/ctype_many.test
      strings/ctype-ucs2.c
=== modified file 'mysql-test/r/ctype_many.result'
--- a/mysql-test/r/ctype_many.result	2010-02-24 09:15:34 +0000
+++ b/mysql-test/r/ctype_many.result	2010-12-15 09:58:37 +0000
@@ -1684,6 +1684,9 @@ ARMENIAN CAPIT ECH	2
 ARMENIAN CAPIT ZA	2
 DROP TABLE t1;
 #
+# Start of 5.5 tests
+#
+#
 # WL#1213 Implement 4-byte UTF8, UTF16 and UTF32
 # Testing that only utf8mb4 is superset for utf8
 # No other Unicode character set pairs have superset/subset relations
@@ -1739,3 +1742,22 @@ ERROR HY000: Illegal mix of collations (
 SELECT CHARSET(CONCAT(utf32, utf16)) FROM t1;
 ERROR HY000: Illegal mix of collations (utf32_general_ci,IMPLICIT) and (utf16_general_ci,IMPLICIT) for operation 'concat'
 DROP TABLE t1;
+#
+# Bug#58321 No warning when characters outside BMP0 is converted to UCS2
+#
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf32);
+CREATE TABLE t2 (a VARCHAR(10) CHARACTER SET ucs2);
+INSERT INTO t1 VALUES (0x10082), (0x12345);
+INSERT INTO t2 SELECT * FROM t1;
+Warnings:
+Warning	1366	Incorrect string value: '\x00\x01\x00\x82' for column 'a' at row 1
+Warning	1366	Incorrect string value: '\x00\x01\x23\x45' for column 'a' at row 2
+SELECT HEX(a) FROM t2;
+HEX(a)
+003F
+003F
+DROP TABLE t1;
+DROP TABLE t2;
+#
+# End of 5.5 tests
+#

=== modified file 'mysql-test/t/ctype_many.test'
--- a/mysql-test/t/ctype_many.test	2010-02-24 09:15:34 +0000
+++ b/mysql-test/t/ctype_many.test	2010-12-15 09:58:37 +0000
@@ -217,6 +217,10 @@ DROP TABLE t1;
 
 
 --echo #
+--echo # Start of 5.5 tests
+--echo #
+
+--echo #
 --echo # WL#1213 Implement 4-byte UTF8, UTF16 and UTF32
 --echo # Testing that only utf8mb4 is superset for utf8
 --echo # No other Unicode character set pairs have superset/subset relations
@@ -284,3 +288,19 @@ SELECT CHARSET(CONCAT(utf32, utf8mb4)) F
 SELECT CHARSET(CONCAT(utf32, utf16)) FROM t1;
 
 DROP TABLE t1;
+
+--echo #
+--echo # Bug#58321 No warning when characters outside BMP0 is converted to UCS2
+--echo #
+CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf32);
+CREATE TABLE t2 (a VARCHAR(10) CHARACTER SET ucs2);
+INSERT INTO t1 VALUES (0x10082), (0x12345);
+INSERT INTO t2 SELECT * FROM t1;
+SELECT HEX(a) FROM t2;
+DROP TABLE t1;
+DROP TABLE t2;
+
+
+--echo #
+--echo # End of 5.5 tests
+--echo #

=== modified file 'strings/ctype-ucs2.c'
--- a/strings/ctype-ucs2.c	2010-12-14 13:26:35 +0000
+++ b/strings/ctype-ucs2.c	2010-12-15 10:31:21 +0000
@@ -2910,7 +2910,10 @@ static int my_uni_ucs2(CHARSET_INFO *cs 
 {
   if ( r+2 > e ) 
     return MY_CS_TOOSMALL2;
-  
+
+  if (wc > 0xFFFF) /* UCS2 does not support characters outside BMP */
+    return MY_CS_ILUNI;
+
   r[0]= (uchar) (wc >> 8);
   r[1]= (uchar) (wc & 0xFF);
   return 2;


Attachment: [text/bzr-bundle] bzr/bar@mysql.com-20101215103121-mxm3g6liz6p3tlqe.bundle
Thread
bzr commit into mysql-trunk-bugfixing branch (bar:3436) Alexander Barkov15 Dec