Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

bk commit into 4.1 tree (ramil:1.2685) BUG#31069

From: <ramil(at)mysql.com>
Date: Wed Oct 03 2007 - 02:42:46 EDT


Below is the list of changes that have just been committed into a local 4.1 repository of ram. When ram 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.2685, 2007-10-03 11:42:44+05:00, ramil@mysql.com +11 -0   Fix for bug #31069: crash in 'sounds like'   and for bug #31070: crash during conversion of charsets   

  Problem: passing a 0 byte length string to some my_mb_wc_XXX()   functions leads to server crash due to improper argument check.   

  Fix: properly check arguments passed to my_mb_wc_XXX() functions.

  mysql-test/include/ctype_common.inc@1.3, 2007-10-03 11:42:43+05:00, ramil@mysql.com +8 -0     Fix for bug #31069: crash in 'sounds like'     and bug #31070: crash during conversion of charsets

  • test case.

  mysql-test/r/ctype_big5.result@1.12, 2007-10-03 11:42:43+05:00, ramil@mysql.com +7 -0     Fix for bug #31069: crash in 'sounds like'     and bug #31070: crash during conversion of charsets

  • test result.

  mysql-test/r/ctype_euckr.result@1.3, 2007-10-03 11:42:43+05:00, ramil@mysql.com +7 -0     Fix for bug #31069: crash in 'sounds like'     and bug #31070: crash during conversion of charsets

  • test result.

  mysql-test/r/ctype_gb2312.result@1.3, 2007-10-03 11:42:43+05:00, ramil@mysql.com +7 -0     Fix for bug #31069: crash in 'sounds like'     and bug #31070: crash during conversion of charsets

  • test result.
Do you need help?X

  mysql-test/r/ctype_gbk.result@1.4, 2007-10-03 11:42:43+05:00, ramil@mysql.com +7 -0     Fix for bug #31069: crash in 'sounds like'     and bug #31070: crash during conversion of charsets

  • test result.

  mysql-test/r/ctype_uca.result@1.15, 2007-10-03 11:42:43+05:00, ramil@mysql.com +7 -0     Fix for bug #31069: crash in 'sounds like'     and bug #31070: crash during conversion of charsets

  • test result.

  strings/ctype-big5.c@1.81, 2007-10-03 11:42:43+05:00, ramil@mysql.com +2 -2     Fix for bug #31069: crash in 'sounds like'     and bug #31070: crash during conversion of charsets

  • check the string length before testing its first byte.

  strings/ctype-cp932.c@1.9, 2007-10-03 11:42:43+05:00, ramil@mysql.com +2 -2     Fix for bug #31069: crash in 'sounds like'     and bug #31070: crash during conversion of charsets

  • check the string length before testing its first byte.

  strings/ctype-euc_kr.c@1.63, 2007-10-03 11:42:43+05:00, ramil@mysql.com +2 -2     Fix for bug #31069: crash in 'sounds like'     and bug #31070: crash during conversion of charsets

  • check the string length before testing its first byte.

  strings/ctype-gb2312.c@1.60, 2007-10-03 11:42:43+05:00, ramil@mysql.com +1 -3     Fix for bug #31069: crash in 'sounds like'     and bug #31070: crash during conversion of charsets

  • check the string length before testing its first byte.

  strings/ctype-sjis.c@1.83, 2007-10-03 11:42:43+05:00, ramil@mysql.com +2 -2     Fix for bug #31069: crash in 'sounds like'     and bug #31070: crash during conversion of charsets

  • check the string length before testing its first byte.

diff -Nrup a/mysql-test/include/ctype_common.inc b/mysql-test/include/ctype_common.inc

--- a/mysql-test/include/ctype_common.inc	2004-12-10 17:58:07 +04:00

+++ b/mysql-test/include/ctype_common.inc 2007-10-03 11:42:43 +05:00
@@ -51,6 +51,14 @@ SELECT c1 as want1result from t1 where  SELECT c1 as want1result from t1 where c1 like 'location%';  DROP TABLE t1;  
Do you need more help?X

+#
+# Bug #31070: crash during conversion of charsets
+#
+create table t1 (a set('a') not null);
+insert into t1 values (),();
+select cast(a as char(1)) from t1;
+drop table t1;
+

 DROP DATABASE d1;
 # Restore settings
 USE test;
diff -Nrup a/mysql-test/r/ctype_big5.result b/mysql-test/r/ctype_big5.result

--- a/mysql-test/r/ctype_big5.result	2005-12-12 21:36:21 +04:00

+++ b/mysql-test/r/ctype_big5.result 2007-10-03 11:42:43 +05:00
@@ -52,6 +52,13 @@ SELECT c1 as want1result from t1 where  want1result
 location
 DROP TABLE t1;
+create table t1 (a set('a') not null);
+insert into t1 values (),();
+select cast(a as char(1)) from t1;
+cast(a as char(1))
+
+
+drop table t1;

 DROP DATABASE d1;
 USE test;
 SET character_set_server= @safe_character_set_server; diff -Nrup a/mysql-test/r/ctype_euckr.result b/mysql-test/r/ctype_euckr.result
--- a/mysql-test/r/ctype_euckr.result	2006-05-12 21:26:40 +05:00

+++ b/mysql-test/r/ctype_euckr.result 2007-10-03 11:42:43 +05:00
@@ -52,6 +52,13 @@ SELECT c1 as want1result from t1 where  want1result
 location
 DROP TABLE t1;
+create table t1 (a set('a') not null);
+insert into t1 values (),();
+select cast(a as char(1)) from t1;
+cast(a as char(1))
+
+
+drop table t1;

 DROP DATABASE d1;
 USE test;
 SET character_set_server= @safe_character_set_server; diff -Nrup a/mysql-test/r/ctype_gb2312.result b/mysql-test/r/ctype_gb2312.result
--- a/mysql-test/r/ctype_gb2312.result	2006-05-12 21:26:40 +05:00

+++ b/mysql-test/r/ctype_gb2312.result 2007-10-03 11:42:43 +05:00
@@ -52,6 +52,13 @@ SELECT c1 as want1result from t1 where  want1result
 location
 DROP TABLE t1;
+create table t1 (a set('a') not null);
+insert into t1 values (),();
+select cast(a as char(1)) from t1;
+cast(a as char(1))
+
+
+drop table t1;

 DROP DATABASE d1;
 USE test;
 SET character_set_server= @safe_character_set_server; diff -Nrup a/mysql-test/r/ctype_gbk.result b/mysql-test/r/ctype_gbk.result
--- a/mysql-test/r/ctype_gbk.result	2005-12-12 21:36:39 +04:00

+++ b/mysql-test/r/ctype_gbk.result 2007-10-03 11:42:43 +05:00
@@ -52,6 +52,13 @@ SELECT c1 as want1result from t1 where  want1result
 location
 DROP TABLE t1;
+create table t1 (a set('a') not null);
+insert into t1 values (),();
+select cast(a as char(1)) from t1;
+cast(a as char(1))
+
+
+drop table t1;

 DROP DATABASE d1;
 USE test;
 SET character_set_server= @safe_character_set_server; diff -Nrup a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result
--- a/mysql-test/r/ctype_uca.result	2005-09-21 22:17:28 +05:00

+++ b/mysql-test/r/ctype_uca.result 2007-10-03 11:42:43 +05:00
@@ -2371,6 +2371,13 @@ SELECT c1 as want1result from t1 where  want1result
 location
 DROP TABLE t1;
+create table t1 (a set('a') not null);
+insert into t1 values (),();
+select cast(a as char(1)) from t1;
+cast(a as char(1))
+
+
+drop table t1;

 DROP DATABASE d1;
 USE test;
 SET character_set_server= @safe_character_set_server; diff -Nrup a/strings/ctype-big5.c b/strings/ctype-big5.c
--- a/strings/ctype-big5.c	2005-12-12 21:38:37 +04:00

+++ b/strings/ctype-big5.c 2007-10-03 11:42:43 +05:00
@@ -6256,12 +6256,12 @@ my_mb_wc_big5(CHARSET_INFO *cs __attribu my_wc_t *pwc,const uchar *s,const uchar *e)
 {  
  • int hi=s[0];
    + int hi;

   if (s >= e)
     return MY_CS_TOOSMALL;    

  • if (hi<0x80)
    + if ((hi= (int) s[0]) < 0x80)
    { pwc[0]=hi; return 1; diff -Nrup a/strings/ctype-cp932.c b/strings/ctype-cp932.c --- a/strings/ctype-cp932.c 2005-12-12 21:39:04 +04:00
    +++ b/strings/ctype-cp932.c 2007-10-03 11:42:43 +05:00
    @@ -5352,12 +5352,12 @@ my_wc_mb_cp932(CHARSET_INFO *cs __attri static int my_mb_wc_cp932(CHARSET_INFO *cs __attribute__((unused)), my_wc_t *pwc, const uchar *s, const uchar *e){
  • int hi=s[0];
    + int hi;

   if (s >= e)
     return MY_CS_TOOSMALL;    

  • if (hi < 0x80)
    + if ((hi= (int) s[0]) < 0x80)
    { pwc[0]=hi; return 1; diff -Nrup a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c --- a/strings/ctype-euc_kr.c 2006-03-23 14:29:27 +04:00
    +++ b/strings/ctype-euc_kr.c 2007-10-03 11:42:43 +05:00
    @@ -8614,12 +8614,12 @@ my_mb_wc_euc_kr(CHARSET_INFO *cs __attri my_wc_t *pwc, const uchar *s, const uchar *e) {
  • int hi=s[0];
    + int hi;

   if (s >= e)
     return MY_CS_TOOSMALL;    

  • if (hi<0x80)
    + if ((hi= (int) s[0]) < 0x80)
    { pwc[0]=hi; return 1; diff -Nrup a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c --- a/strings/ctype-gb2312.c 2006-03-23 14:29:27 +04:00
    +++ b/strings/ctype-gb2312.c 2007-10-03 11:42:43 +05:00
    @@ -5665,12 +5665,10 @@ my_mb_wc_gb2312(CHARSET_INFO *cs __attr my_wc_t *pwc, const uchar *s, const uchar *e){ int hi;
  • hi=(int) s[0]; - if (s >= e) return MY_CS_TOOSMALL;
  • if (hi<0x80)
    + if ((hi= (int) s[0]) < 0x80)
    { pwc[0]=hi; return 1; diff -Nrup a/strings/ctype-sjis.c b/strings/ctype-sjis.c --- a/strings/ctype-sjis.c 2005-12-12 21:39:14 +04:00
    +++ b/strings/ctype-sjis.c 2007-10-03 11:42:43 +05:00
    @@ -4512,12 +4512,12 @@ mb: static int my_mb_wc_sjis(CHARSET_INFO *cs __attribute__((unused)), my_wc_t *pwc, const uchar *s, const uchar *e){
  • int hi=s[0];
    + int hi;

   if (s >= e)
     return MY_CS_TOOSMALL;    

  • if (hi < 0x80)
    + if ((hi= (int) s[0]) < 0x80)
    { pwc[0]=hi; return 1;
-- 
MySQL Code Commits Mailing List
For list archives: 
http://lists.mysql.com/commits
To unsubscribe:    
http://lists.mysql.com/commits?unsub=lists@pantek.com
Received on Wed Oct 3 02:43:00 2007

This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 09:50:42 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library