List:Commits« Previous MessageNext Message »
From:holyfoot Date:October 12 2006 10:50am
Subject:bk commit into 5.0 tree (holyfoot:1.2280)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of hf. When hf 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, 2006-10-12 13:50:22+05:00, holyfoot@stripped +10 -0
  Merge bk@stripped:mysql-4.1
  into  mysql.com:/home/hf/mysql-5.0.mrg
  MERGE: 1.1616.2144.177

  include/m_ctype.h@stripped, 2006-10-12 13:48:36+05:00, holyfoot@stripped +0 -0
    Auto merged
    MERGE: 1.102.1.8

  mysql-test/r/ctype_utf8.result@stripped, 2006-10-12 13:48:36+05:00, holyfoot@stripped +0
-0
    Auto merged
    MERGE: 1.45.1.29

  mysql-test/r/type_enum.result@stripped, 2006-10-12 13:48:36+05:00, holyfoot@stripped +0 -0
    Auto merged
    MERGE: 1.24.1.2

  mysql-test/t/ctype_utf8.test@stripped, 2006-10-12 13:48:36+05:00, holyfoot@stripped +0 -0
    Auto merged
    MERGE: 1.57.1.19

  sql/item_func.cc@stripped, 2006-10-12 13:48:36+05:00, holyfoot@stripped +0 -0
    Auto merged
    MERGE: 1.124.42.14

  sql/sql_select.cc@stripped, 2006-10-12 13:48:36+05:00, holyfoot@stripped +0 -0
    Auto merged
    MERGE: 1.216.125.11

  sql/table.cc@stripped, 2006-10-12 13:48:37+05:00, holyfoot@stripped +0 -0
    Auto merged
    MERGE: 1.111.4.8

  sql/unireg.cc@stripped, 2006-10-12 13:48:37+05:00, holyfoot@stripped +0 -0
    Auto merged
    MERGE: 1.43.1.8

  strings/ctype-mb.c@stripped, 2006-10-12 13:49:32+05:00, holyfoot@stripped +0 -0
    SCCS merged
    MERGE: 1.34.1.10

  strings/ctype-utf8.c@stripped, 2006-10-12 13:50:17+05:00, holyfoot@stripped +0 -0
    SCCS merged
    MERGE: 1.78.1.12

# 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:	holyfoot
# Host:	deer.(none)
# Root:	/home/hf/mysql-5.0.mrg/RESYNC

--- 1.121/include/m_ctype.h	2006-10-12 13:50:29 +05:00
+++ 1.122/include/m_ctype.h	2006-10-12 13:50:29 +05:00
@@ -112,6 +112,8 @@ enum my_lex_states
 
 struct charset_info_st;
 
+
+/* See strings/CHARSET_INFO.txt for information about this structure  */
 typedef struct my_collation_handler_st
 {
   my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint));
@@ -154,6 +156,7 @@ extern MY_COLLATION_HANDLER my_collation
 extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler;
 
 
+/* See strings/CHARSET_INFO.txt about information on this structure  */
 typedef struct my_charset_handler_st
 {
   my_bool (*init)(struct charset_info_st *, void *(*alloc)(uint));
@@ -216,6 +219,7 @@ extern MY_CHARSET_HANDLER my_charset_8bi
 extern MY_CHARSET_HANDLER my_charset_ucs2_handler;
 
 
+/* See strings/CHARSET_INFO.txt about information on this structure  */
 typedef struct charset_info_st
 {
   uint      number;

--- 1.235/sql/table.cc	2006-10-12 13:50:29 +05:00
+++ 1.236/sql/table.cc	2006-10-12 13:50:29 +05:00
@@ -468,7 +468,21 @@ int openfrm(THD *thd, const char *name, 
                                                         count)))
         goto err;
       for (count= 0; count < interval->count; count++)
-        interval->type_lengths[count]= strlen(interval->type_names[count]);
+      {
+        char *val= (char*) interval->type_names[count];
+        interval->type_lengths[count]= strlen(val);
+        /*
+          Replace all ',' symbols with NAMES_SEP_CHAR.
+          See the comment in unireg.cc, pack_fields() function
+          for details.
+        */
+        for (uint cnt= 0 ; cnt < interval->type_lengths[count] ; cnt++)
+        {
+          char c= val[cnt];
+          if (c == ',')
+            val[cnt]= NAMES_SEP_CHAR;
+        }       
+      }
       interval->type_lengths[count]= 0;
     }
   }

--- 1.76/sql/unireg.cc	2006-10-12 13:50:29 +05:00
+++ 1.77/sql/unireg.cc	2006-10-12 13:50:29 +05:00
@@ -718,6 +718,21 @@ static bool pack_fields(File file, List<
 	tmp.append(NAMES_SEP_CHAR);
 	for (const char **pos=field->interval->type_names ; *pos ; pos++)
 	{
+          char *val= (char*) *pos;
+          uint str_len= strlen(val);
+          /*
+            Note, hack: in old frm NAMES_SEP_CHAR is used to separate
+            names in the interval (ENUM/SET). To allow names to contain
+            NAMES_SEP_CHAR, we replace it with a comma before writing frm.
+            Backward conversion is done during frm file opening,
+            See table.cc, openfrm() function
+          */
+          for (uint cnt= 0 ; cnt < str_len ; cnt++)
+          {
+            char c= val[cnt];
+            if (c == NAMES_SEP_CHAR)
+              val[cnt]= ',';
+          }
 	  tmp.append(*pos);
 	  tmp.append(NAMES_SEP_CHAR);
 	}

--- 1.104/mysql-test/r/ctype_utf8.result	2006-10-12 13:50:29 +05:00
+++ 1.105/mysql-test/r/ctype_utf8.result	2006-10-12 13:50:29 +05:00
@@ -1155,6 +1155,81 @@ check table t1;
 Table	Op	Msg_type	Msg_text
 test.t1	check	status	OK
 drop table t1;
+set names utf8;
+create table t1 (s1 char(5) character set utf8);
+insert into t1 values
+('a'),('b'),(null),('ペテルグル'),('ü'),('Y');
+create index it1 on t1 (s1);
+select s1 as before_delete_general_ci from t1 where s1 like 'ペテ%';
+before_delete_general_ci
+ペテルグル
+delete from t1 where s1 = 'Y';
+select s1 as after_delete_general_ci from t1 where s1 like 'ペテ%';
+after_delete_general_ci
+ペテルグル
+drop table t1;
+set names utf8;
+create table t1 (s1 char(5) character set utf8 collate utf8_unicode_ci);
+insert into t1 values
+('a'),('b'),(null),('ペテルグル'),('ü'),('Y');
+create index it1 on t1 (s1);
+select s1 as before_delete_unicode_ci from t1 where s1 like 'ペテ%';
+before_delete_unicode_ci
+ペテルグル
+delete from t1 where s1 = 'Y';
+select s1 as after_delete_unicode_ci from t1 where s1 like 'ペテ%';
+after_delete_unicode_ci
+ペテルグル
+drop table t1;
+set names utf8;
+create table t1 (s1 char(5) character set utf8 collate utf8_bin);
+insert into t1 values
+('a'),('b'),(null),('ペテルグル'),('ü'),('Y');
+create index it1 on t1 (s1);
+select s1 as before_delete_bin from t1 where s1 like 'ペテ%';
+before_delete_bin
+ペテルグル
+delete from t1 where s1 = 'Y';
+select s1 as after_delete_bin from t1 where s1 like 'ペテ%';
+after_delete_bin
+ペテルグル
+drop table t1;
+set names utf8;
+create table t1 (a varchar(30) not null primary key)
+engine=innodb  default character set utf8 collate utf8_general_ci;
+insert into t1 values ('あいうえおかきくけこさしすせそ');
+insert into t1 values ('さしすせそかきくけこあいうえお');
+select a as gci1 from t1 where a like 'さしすせそかきくけこあいうえお%';
+gci1
+さしすせそかきくけこあいうえお
+select a as gci2 from t1 where a like 'あいうえおかきくけこさしすせそ';
+gci2
+あいうえおかきくけこさしすせそ
+drop table t1;
+set names utf8;
+create table t1 (a varchar(30) not null primary key)
+engine=innodb default character set utf8 collate utf8_unicode_ci;
+insert into t1 values ('あいうえおかきくけこさしすせそ');
+insert into t1 values ('さしすせそかきくけこあいうえお');
+select a as uci1 from t1 where a like 'さしすせそかきくけこあいうえお%';
+uci1
+さしすせそかきくけこあいうえお
+select a as uci2 from t1 where a like 'あいうえおかきくけこさしすせそ';
+uci2
+あいうえおかきくけこさしすせそ
+drop table t1;
+set names utf8;
+create table t1 (a varchar(30) not null primary key)
+engine=innodb default character set utf8 collate utf8_bin;
+insert into t1 values ('あいうえおかきくけこさしすせそ');
+insert into t1 values ('さしすせそかきくけこあいうえお');
+select a as bin1 from t1 where a like 'さしすせそかきくけこあいうえお%';
+bin1
+さしすせそかきくけこあいうえお
+select a as bin2 from t1 where a like 'あいうえおかきくけこさしすせそ';
+bin2
+あいうえおかきくけこさしすせそ
+drop table t1;
 SET NAMES utf8;
 CREATE TABLE t1 (id int PRIMARY KEY,
 a varchar(16) collate utf8_unicode_ci NOT NULL default '',

--- 1.96/mysql-test/t/ctype_utf8.test	2006-10-12 13:50:29 +05:00
+++ 1.97/mysql-test/t/ctype_utf8.test	2006-10-12 13:50:29 +05:00
@@ -942,6 +942,76 @@ check table t1;
 drop table t1;
 
 #
+# Bug#20471 LIKE search fails with indexed utf8 char column
+#
+set names utf8;
+create table t1 (s1 char(5) character set utf8);
+insert into t1 values
+('a'),('b'),(null),('ペテルグル'),('ü'),('Y');
+create index it1 on t1 (s1);
+select s1 as before_delete_general_ci from t1 where s1 like 'ペテ%';
+delete from t1 where s1 = 'Y';
+select s1 as after_delete_general_ci from t1 where s1 like 'ペテ%';
+drop table t1;
+
+set names utf8;
+create table t1 (s1 char(5) character set utf8 collate utf8_unicode_ci);
+insert into t1 values
+('a'),('b'),(null),('ペテルグル'),('ü'),('Y');
+create index it1 on t1 (s1);
+select s1 as before_delete_unicode_ci from t1 where s1 like 'ペテ%';
+delete from t1 where s1 = 'Y';
+select s1 as after_delete_unicode_ci from t1 where s1 like 'ペテ%';
+drop table t1;
+
+set names utf8;
+create table t1 (s1 char(5) character set utf8 collate utf8_bin);
+insert into t1 values
+('a'),('b'),(null),('ペテルグル'),('ü'),('Y');
+create index it1 on t1 (s1);
+select s1 as before_delete_bin from t1 where s1 like 'ペテ%';
+delete from t1 where s1 = 'Y';
+select s1 as after_delete_bin from t1 where s1 like 'ペテ%';
+drop table t1;
+
+# additional tests from duplicate bug#20744 MySQL return no result
+
+set names utf8;
+--disable_warnings
+create table t1 (a varchar(30) not null primary key)
+engine=innodb  default character set utf8 collate utf8_general_ci;
+--enable_warnings
+insert into t1 values ('あいうえおかきくけこさしすせそ');
+insert into t1 values ('さしすせそかきくけこあいうえお');
+select a as gci1 from t1 where a like 'さしすせそかきくけこあいうえお%';
+select a as gci2 from t1 where a like 'あいうえおかきくけこさしすせそ';
+drop table t1;
+
+set names utf8;
+--disable_warnings
+create table t1 (a varchar(30) not null primary key)
+engine=innodb default character set utf8 collate utf8_unicode_ci;
+--enable_warnings
+insert into t1 values ('あいうえおかきくけこさしすせそ');
+insert into t1 values ('さしすせそかきくけこあいうえお');
+select a as uci1 from t1 where a like 'さしすせそかきくけこあいうえお%';
+select a as uci2 from t1 where a like 'あいうえおかきくけこさしすせそ';
+drop table t1;
+
+set names utf8;
+--disable_warnings
+create table t1 (a varchar(30) not null primary key)
+engine=innodb default character set utf8 collate utf8_bin;
+--enable_warnings
+insert into t1 values ('あいうえおかきくけこさしすせそ');
+insert into t1 values ('さしすせそかきくけこあいうえお');
+select a as bin1 from t1 where a like 'さしすせそかきくけこあいうえお%';
+select a as bin2 from t1 where a like 'あいうえおかきくけこさしすせそ';
+drop table t1;
+
+
+
+#
 # Bug#14896: Comparison with a key in a partial index over mb chararacter field
 #
 

--- 1.50/strings/ctype-mb.c	2006-10-12 13:50:29 +05:00
+++ 1.51/strings/ctype-mb.c	2006-10-12 13:50:29 +05:00
@@ -474,15 +474,35 @@ static void my_hash_sort_mb_bin(CHARSET_
 
 
 /* 
-  Write max key: create a buffer with multibyte
-  representation of the max_sort_char character,
-  and copy it into max_str in a loop. 
+  Fill the given buffer with 'maximum character' for given charset
+  SYNOPSIS
+      pad_max_char()
+      cs   Character set
+      str  Start of buffer to fill
+      end  End of buffer to fill
+
+  DESCRIPTION
+      Write max key:
+      - for non-Unicode character sets:
+        just set to 255.
+      - for Unicode character set (utf-8):
+        create a buffer with multibyte representation of the max_sort_char
+        character, and copy it into max_str in a loop. 
 */
 static void pad_max_char(CHARSET_INFO *cs, char *str, char *end)
 {
   char buf[10];
-  char buflen= cs->cset->wc_mb(cs, cs->max_sort_char, (uchar*) buf,
-                               (uchar*) buf + sizeof(buf));
+  char buflen;
+  
+  if (!(cs->state & MY_CS_UNICODE))
+  {
+    bfill(str, end - str, 255);
+    return;
+  }
+  
+  buflen= cs->cset->wc_mb(cs, cs->max_sort_char, (uchar*) buf,
+                          (uchar*) buf + sizeof(buf));
+  
   DBUG_ASSERT(buflen > 0);
   do
   {
@@ -927,7 +947,7 @@ MY_COLLATION_HANDLER my_collation_mb_bin
     my_strnncollsp_mb_bin,
     my_strnxfrm_mb_bin,
     my_strnxfrmlen_simple,
-    my_like_range_simple,
+    my_like_range_mb,
     my_wildcmp_mb_bin,
     my_strcasecmp_mb_bin,
     my_instr_mb,

--- 1.99/strings/ctype-utf8.c	2006-10-12 13:50:29 +05:00
+++ 1.100/strings/ctype-utf8.c	2006-10-12 13:50:29 +05:00
@@ -2612,7 +2612,7 @@ CHARSET_INFO my_charset_utf8_bin=
     1,                  /* mbminlen     */
     3,                  /* mbmaxlen     */
     0,                  /* min_sort_char */
-    255,                /* max_sort_char */
+    0xFFFF,             /* max_sort_char */
     ' ',                /* pad char      */
     0,                  /* escape_with_backslash_is_dangerous */
     &my_charset_utf8_handler,

--- 1.27/mysql-test/r/type_enum.result	2006-10-12 13:50:29 +05:00
+++ 1.28/mysql-test/r/type_enum.result	2006-10-12 13:50:29 +05:00
@@ -1745,3 +1745,12 @@ create table t1 (a set('x','y') default 
 alter table t1 alter a set default 'z';
 ERROR 42000: Invalid default value for 'a'
 drop table t1;
+create table t1 (f1 int);
+alter table t1 add f2 enum(0xFFFF);
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `f1` int(11) default NULL,
+  `f2` enum('ÿÿ') default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
Thread
bk commit into 5.0 tree (holyfoot:1.2280)holyfoot12 Oct