List:Commits« Previous MessageNext Message »
From:Alexander Barkov Date:May 5 2009 6:55am
Subject:bzr commit into mysql-5.1-bugteam branch (bar:2894) Bug#44352
View as plain text  
#At file:///home/bar/mysql-bzr/mysql-5.1.b44352/ based on revid:serg@stripped

 2894 Alexander Barkov	2009-05-05
      Bug#44352 UPPER/LOWER function doesn't work correctly
      on cp932 and sjis environment.
      Problem: case conversion erroneously changes the second bytes
      of multi-byte sequences because single-byte functions were
      called in a mistake.
      Fix: call multi-byte aware functions instead.

    modified:
      mysql-test/r/ctype_cp932_binlog_stm.result
      mysql-test/r/ctype_sjis.result
      mysql-test/t/ctype_cp932_binlog_stm.test
      mysql-test/t/ctype_sjis.test
      strings/ctype-cp932.c
      strings/ctype-sjis.c
=== modified file 'mysql-test/r/ctype_cp932_binlog_stm.result'
--- a/mysql-test/r/ctype_cp932_binlog_stm.result	2008-10-02 05:56:07 +0000
+++ b/mysql-test/r/ctype_cp932_binlog_stm.result	2009-05-05 06:55:22 +0000
@@ -46,4 +46,12 @@ master-bin.000001	1137	Query	1	1216	use 
 End of 5.0 tests
 SHOW BINLOG EVENTS FROM 364;
 ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
+Bug#44352 UPPER/LOWER function doesn't work correctly on cp932 and sjis environment.
+CREATE TABLE t1 (a varchar(16)) character set cp932;
+INSERT INTO t1 VALUES (0x8372835E),(0x8352835E);
+SELECT hex(a), hex(lower(a)), hex(upper(a)) FROM t1 ORDER BY binary(a);
+hex(a)	hex(lower(a))	hex(upper(a))
+8352835E	8352835E	8352835E
+8372835E	8372835E	8372835E
+DROP TABLE t1;
 End of 5.1 tests

=== modified file 'mysql-test/r/ctype_sjis.result'
--- a/mysql-test/r/ctype_sjis.result	2008-02-20 18:49:26 +0000
+++ b/mysql-test/r/ctype_sjis.result	2009-05-05 06:55:22 +0000
@@ -209,3 +209,13 @@ SET NAMES sjis;
 SELECT HEX('²“‘@Œ\') FROM DUAL;
 HEX('²“‘@Œ\')
 8DB2939181408C5C
+# Start of 5.1 tests
+Bug#44352 UPPER/LOWER function doesn't work correctly on cp932 and sjis environment.
+CREATE TABLE t1 (a varchar(16)) character set sjis;
+INSERT INTO t1 VALUES (0x8372835E),(0x8352835E);
+SELECT hex(a), hex(lower(a)), hex(upper(a)) FROM t1 ORDER BY binary(a);
+hex(a)	hex(lower(a))	hex(upper(a))
+8352835E	8352835E	8352835E
+8372835E	8372835E	8372835E
+DROP TABLE t1;
+# End of 5.1 tests

=== modified file 'mysql-test/t/ctype_cp932_binlog_stm.test'
--- a/mysql-test/t/ctype_cp932_binlog_stm.test	2007-05-30 10:23:47 +0000
+++ b/mysql-test/t/ctype_cp932_binlog_stm.test	2009-05-05 06:55:22 +0000
@@ -34,4 +34,10 @@ delimiter ;|
 --error 1220
 SHOW BINLOG EVENTS FROM 364;
 
+--echo Bug#44352 UPPER/LOWER function doesn't work correctly on cp932 and sjis environment.
+CREATE TABLE t1 (a varchar(16)) character set cp932;
+INSERT INTO t1 VALUES (0x8372835E),(0x8352835E);
+SELECT hex(a), hex(lower(a)), hex(upper(a)) FROM t1 ORDER BY binary(a);
+DROP TABLE t1;
+
 --echo End of 5.1 tests

=== modified file 'mysql-test/t/ctype_sjis.test'
--- a/mysql-test/t/ctype_sjis.test	2008-02-20 18:49:26 +0000
+++ b/mysql-test/t/ctype_sjis.test	2009-05-05 06:55:22 +0000
@@ -83,3 +83,13 @@ SET NAMES sjis;
 SELECT HEX('o # Start of 5.1 tests
+
+--echo Bug#44352 UPPER/LOWER function doesn't work correctly on cp932 and sjis environment.
+CREATE TABLE t1 (a varchar(16)) character set sjis;
+INSERT INTO t1 VALUES (0x8372835E),(0x8352835E);
+SELECT hex(a), hex(lower(a)), hex(upper(a)) FROM t1 ORDER BY binary(a);
+DROP TABLE t1;
+
+--echo # End of 5.1 tests

=== modified file 'strings/ctype-cp932.c'
--- a/strings/ctype-cp932.c	2007-11-29 10:35:15 +0000
+++ b/strings/ctype-cp932.c	2009-05-05 06:55:22 +0000
@@ -5489,10 +5489,10 @@ static MY_CHARSET_HANDLER my_charset_han
   my_mb_wc_cp932,	/* mb_wc */
   my_wc_mb_cp932,	/* wc_mb */
   my_mb_ctype_mb,
-  my_caseup_str_8bit,
-  my_casedn_str_8bit,
-  my_caseup_8bit,
-  my_casedn_8bit,
+  my_caseup_str_mb,
+  my_casedn_str_mb,
+  my_caseup_mb,
+  my_casedn_mb,
   my_snprintf_8bit,
   my_long10_to_str_8bit,
   my_longlong10_to_str_8bit,

=== modified file 'strings/ctype-sjis.c'
--- a/strings/ctype-sjis.c	2007-10-04 07:10:15 +0000
+++ b/strings/ctype-sjis.c	2009-05-05 06:55:22 +0000
@@ -4650,10 +4650,10 @@ static MY_CHARSET_HANDLER my_charset_han
   my_mb_wc_sjis,	/* mb_wc */
   my_wc_mb_sjis,	/* wc_mb */
   my_mb_ctype_mb,
-  my_caseup_str_8bit,
-  my_casedn_str_8bit,
-  my_caseup_8bit,
-  my_casedn_8bit,
+  my_caseup_str_mb,
+  my_casedn_str_mb,
+  my_caseup_mb,
+  my_casedn_mb,
   my_snprintf_8bit,
   my_long10_to_str_8bit,
   my_longlong10_to_str_8bit,

Attachment: [text/bzr-bundle] bzr/bar@mysql.com-20090505065522-0n7tf57v5ivwjc17.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (bar:2894) Bug#44352Alexander Barkov5 May