List:Commits« Previous MessageNext Message »
From:bar Date:March 23 2006 10:03am
Subject:bk commit into 5.0 tree (bar:1.2109) BUG#15376
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of bar. When bar does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2109 06/03/23 14:03:39 bar@stripped +5 -0
  Bug#15376: Unassigned multibyte codes are converted to U+0000
  Mergeing changes into 5.0

  strings/ctype-eucjpms.c
    1.13 06/03/23 14:03:32 bar@stripped +13 -13
    Applying changes to eucjpms, similar to ujis.
    Note: eucjpms appeared in 5.0 so the original patch,
    which was for for 4.1, didn't fix eucjpms.

  strings/ctype-cp932.c
    1.12 06/03/23 14:03:32 bar@stripped +3 -3
    After merge fix

  mysql-test/t/ctype_eucjpms.test
    1.9 06/03/23 14:03:31 bar@stripped +17 -0
    Adding test

  mysql-test/r/ctype_ujis.result
    1.18 06/03/23 14:03:31 bar@stripped +6 -6
    After merge fix

  mysql-test/r/ctype_eucjpms.result
    1.6 06/03/23 14:03:31 bar@stripped +6 -0
    Adding test

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	bar
# Host:	bar.intranet.mysql.r18.ru
# Root:	/usr/home/bar/mysql-5.0

--- 1.17/mysql-test/r/ctype_ujis.result	2006-03-23 12:41:15 +04:00
+++ 1.18/mysql-test/r/ctype_ujis.result	2006-03-23 14:03:31 +04:00
@@ -2307,6 +2307,12 @@
 c2h
 ab_def
 drop table t1;
+select hex(convert(_ujis 0xA5FE41 using ucs2));
+hex(convert(_ujis 0xA5FE41 using ucs2))
+003F0041
+select hex(convert(_ujis 0x8FABF841 using ucs2));
+hex(convert(_ujis 0x8FABF841 using ucs2))
+003F0041
 DROP TABLE IF EXISTS t1, t2;
 DROP PROCEDURE IF EXISTS sp1;
 set names ujis;
@@ -2337,9 +2343,3 @@
 set names default;
 set character_set_database=default;
 set character_set_server=default;
-select hex(convert(_ujis 0xA5FE41 using ucs2));
-hex(convert(_ujis 0xA5FE41 using ucs2))
-003F0041
-select hex(convert(_ujis 0x8FABF841 using ucs2));
-hex(convert(_ujis 0x8FABF841 using ucs2))
-003F0041

--- 1.5/mysql-test/r/ctype_eucjpms.result	2005-07-19 01:24:46 +05:00
+++ 1.6/mysql-test/r/ctype_eucjpms.result	2006-03-23 14:03:31 +04:00
@@ -9819,3 +9819,9 @@
 eucjpms_bin	61
 eucjpms_bin	6120
 drop table t1;
+select hex(convert(_eucjpms 0xA5FE41 using ucs2));
+hex(convert(_eucjpms 0xA5FE41 using ucs2))
+003F0041
+select hex(convert(_eucjpms 0x8FABF841 using ucs2));
+hex(convert(_eucjpms 0x8FABF841 using ucs2))
+003F0041

--- 1.8/mysql-test/t/ctype_eucjpms.test	2005-07-19 01:24:46 +05:00
+++ 1.9/mysql-test/t/ctype_eucjpms.test	2006-03-23 14:03:31 +04:00
@@ -363,3 +363,20 @@
 -- source include/ctype_filesort.inc
 SET collation_connection='eucjpms_bin';
 -- source include/ctype_filesort.inc
+
+
+#
+# Bugs#15375: Unassigned multibyte codes are broken
+# into parts when converting to Unicode.
+# This query should return 0x003F0041. I.e. it should
+# scan unassigned double-byte character 0xA5FE, convert
+# it as QUESTION MARK 0x003F and then scan the next
+# character, which is a single byte character 0x41.
+#
+select hex(convert(_eucjpms 0xA5FE41 using ucs2));
+# This one should return 0x003F0041:
+# scan unassigned three-byte character 0x8FABF8,
+# convert it as QUESTION MARK 0x003F and then scan
+# the next character, which is a single byte character 0x41.
+select hex(convert(_eucjpms 0x8FABF841 using ucs2));
+

--- 1.11/strings/ctype-cp932.c	2005-10-14 13:37:11 +05:00
+++ 1.12/strings/ctype-cp932.c	2006-03-23 14:03:32 +04:00
@@ -5355,7 +5355,7 @@
   int hi=s[0];
   
   if (s >= e)
-    return MY_CS_TOOFEW(0);
+    return MY_CS_TOOSMALL;
   
   if (hi < 0x80)
   {
@@ -5370,10 +5370,10 @@
   }
   
   if (s+2>e)
-    return MY_CS_TOOFEW(0);
+    return MY_CS_TOOSMALL2;
   
   if (!(pwc[0]=func_cp932_uni_onechar((hi<<8)+s[1])))
-    return MY_CS_ILSEQ;
+    return -2;
   
   return 2;
 }

--- 1.12/strings/ctype-eucjpms.c	2005-10-13 19:09:57 +05:00
+++ 1.13/strings/ctype-eucjpms.c	2006-03-23 14:03:32 +04:00
@@ -243,7 +243,7 @@
 		  const uchar *e __attribute__((unused)))
 {
   wc[0]=tab_jisx0201_uni[*s];
-  return (!wc[0] && s[0]) ? MY_CS_ILSEQ : 1;
+  return (!wc[0] && s[0]) ? -1 : 1;
 }
 
 
@@ -8473,7 +8473,7 @@
   int c1,c2,c3;
   
   if (s >= e)
-    return MY_CS_TOOFEW(0);
+    return MY_CS_TOOSMALL;
   
   c1=s[0];
   
@@ -8485,7 +8485,7 @@
   }
   
   if (s+2>e)
-    return MY_CS_TOOFEW(0);
+    return MY_CS_TOOSMALL2;
     
   c2=s[1];
   
@@ -8500,7 +8500,7 @@
     {
       pwc[0]=my_jisx0208_uni_onechar( ((c1-0x80) << 8) + (c2-0x80));
       if (!pwc[0])
-        return MY_CS_ILSEQ;
+        return -2;
     }
     else
     {
@@ -8520,7 +8520,7 @@
     
     ret = my_mb_wc_jisx0201(cs,pwc,s+1,e);
     if (ret!=1)
-      return ret;
+      return -2;
     return 2;
   }
   
@@ -8531,7 +8531,7 @@
       return MY_CS_ILSEQ;
     
     if (s+3>e)
-      return MY_CS_TOOFEW(0);
+      return MY_CS_TOOSMALL3;
     
     c3=s[2];
     if (c3 < 0xA1 || c3>=0xFF)
@@ -8540,8 +8540,8 @@
     if (c2<0xF5)
     {
       pwc[0]=my_jisx0212_uni_onechar((c2-0x80)*256 + (c3-0x80));
-      if (!pwc)
-        return MY_CS_ILSEQ;
+      if (!pwc[0])
+        return -3;
     }
     else
     {
@@ -8572,7 +8572,7 @@
   if ((jp=my_uni_jisx0208_onechar(wc)))
   {
     if (s+2>e)
-      return MY_CS_TOOSMALL;
+      return MY_CS_TOOSMALL2;
       
     jp+=0x8080;
     s[0]=jp>>8;
@@ -8584,7 +8584,7 @@
   if (my_wc_mb_jisx0201(c,wc,s,e) == 1)
   {
     if (s+2>e)
-      return MY_CS_TOOSMALL;
+      return MY_CS_TOOSMALL2;
     s[1]= s[0];
     s[0]= 0x8E;
     return 2;
@@ -8594,7 +8594,7 @@
   if ((jp=my_uni_jisx0212_onechar(wc)))
   {
     if (s+3>e)
-      return MY_CS_TOOSMALL;
+      return MY_CS_TOOSMALL3;
       
     jp+=0x8080;
     s[0]=0x8F;
@@ -8608,7 +8608,7 @@
   if (wc>=0xE000 && wc<0xE3AC)
   { 
     if (s+2>e)
-      return MY_CS_TOOSMALL;
+      return MY_CS_TOOSMALL2;
       
     c1=((unsigned)(wc-0xE000)/94)+0xF5;
     s[0]=c1;
@@ -8622,7 +8622,7 @@
   if (wc>=0xE3AC && wc<0xE758)
   {
     if (s+3>e)
-      return MY_CS_TOOSMALL;
+      return MY_CS_TOOSMALL3;
       
     s[0]=0x8F;
     c1=((unsigned)(wc-0xE3AC)/94)+0xF5;
Thread
bk commit into 5.0 tree (bar:1.2109) BUG#15376bar23 Mar