List:Commits« Previous MessageNext Message »
From:bar Date:July 20 2007 11:47am
Subject:bk commit into 5.2 tree (bar:1.2538) BUG#29459
View as plain text  
Below is the list of changes that have just been committed into a local
5.2 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@stripped, 2007-07-20 14:47:36+05:00, bar@stripped +4 -0
  Bug#29459 server died handling latin2 collate latin2_czech_cs
  Problem: sizeof() was errouneously used instead array_elements(),
  which made the loop access to wrong memory.
  Fix: changing sizeof() to array_elements().

  mysql-test/r/ctype_latin2_ch.result@stripped, 2007-07-20 14:47:34+05:00, bar@stripped +11 -0
    Adding test

  mysql-test/t/ctype_latin2_ch.test@stripped, 2007-07-20 14:47:34+05:00, bar@stripped +12 -0
    Adding test

  strings/ctype-czech.c@stripped, 2007-07-20 14:47:34+05:00, bar@stripped +1 -1
    Changing sizeof() to array_elements()

  strings/ctype-win1250ch.c@stripped, 2007-07-20 14:47:34+05:00, bar@stripped +3 -1
    Changing sizeof() to array_elements()

# 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.myoffice.izhnet.ru
# Root:	/home/bar/mysql-work/mysql-5.2.b29459

--- 1.68/strings/ctype-czech.c	2007-06-21 20:26:24 +05:00
+++ 1.69/strings/ctype-czech.c	2007-07-20 14:47:34 +05:00
@@ -313,7 +313,7 @@ while (1)						\
   if (value == 255)					\
   {							\
     int i;						\
-    for (i = 0; i < (int) sizeof(doubles); i++)		\
+    for (i = 0; i < (int) array_elements(doubles); i++) \
     {							\
       const char * pattern = doubles[i].word;		\
       const char * q = (const char *) p;		\

--- 1.60/strings/ctype-win1250ch.c	2007-06-21 14:59:25 +05:00
+++ 1.61/strings/ctype-win1250ch.c	2007-07-20 14:47:34 +05:00
@@ -405,6 +405,8 @@ static struct wordvalue doubles[]=
   { (uchar*) "C",  0xa6, 0x01 },
 };
 
+#define NDOUBLES array_elements(doubles)
+
 /*
   ml - a flag indicating whether automatically
        switch to the secondary level,
@@ -421,7 +423,7 @@ static struct wordvalue doubles[]=
 			: _sort_order_win1250ch2[*p]);			\
 		if (value == 0xff) {					\
 			int i;						\
-			for (i = 0; i < (int) sizeof(doubles); i++) {	\
+			for (i = 0; i < (int) NDOUBLES; i++) {		\
 				const uchar *patt = doubles[i].word;	\
 				const uchar *q = (const uchar *) p;	\
 				while (*patt				\

--- 1.3/mysql-test/r/ctype_latin2_ch.result	2007-04-03 16:16:07 +05:00
+++ 1.4/mysql-test/r/ctype_latin2_ch.result	2007-07-20 14:47:34 +05:00
@@ -342,3 +342,14 @@ hex(weight_string('a' LEVEL 8))
 select hex(weight_string('a' LEVEL 1,8));
 hex(weight_string('a' LEVEL 1,8))
 82016100
+create table t1 (
+a varchar(2) character set latin2 collate latin2_czech_cs,
+primary key(a)
+);
+insert into t1 set a=0x5ff;
+insert into t1 set a=0xff;
+select hex(a) from t1;
+hex(a)
+05FF
+FF
+drop table t1;

--- 1.3/mysql-test/t/ctype_latin2_ch.test	2007-04-03 16:16:08 +05:00
+++ 1.4/mysql-test/t/ctype_latin2_ch.test	2007-07-20 14:47:34 +05:00
@@ -43,3 +43,15 @@ set names latin2 collate latin2_czech_cs
 --source include/weight_string_l4.inc
 --source include/weight_string_l12.inc
 --source include/weight_string_l14.inc
+
+#
+# Bug#29459 server died handling latin2 collate latin2_czech_cs
+#
+create table t1 (
+  a varchar(2) character set latin2 collate latin2_czech_cs,
+  primary key(a)
+);
+insert into t1 set a=0x5ff;
+insert into t1 set a=0xff;
+select hex(a) from t1;
+drop table t1;
Thread
bk commit into 5.2 tree (bar:1.2538) BUG#29459bar20 Jul