List:Commits« Previous MessageNext Message »
From:gluh Date:September 11 2006 9:50am
Subject:bk commit into 4.1 tree (gluh:1.2549) BUG#20922
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of gluh. When gluh 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-09-11 14:50:46+05:00, gluh@stripped +4 -0
  Bug#20922 mysql removes a name of first column in a table
  0xFF is internal separator for SET|ENUM names. 
  If this symbol is present in SET|ENUM names then we replace it with 
  ','(deprecated symbol for SET|ENUM names) during frm creation
  and restore to 0xFF during frm opening

  mysql-test/r/type_enum.result@stripped, 2006-09-11 14:50:43+05:00, gluh@stripped +9 -0
    Bug#20922 mysql removes a name of first column in a table
    test case

  mysql-test/t/type_enum.test@stripped, 2006-09-11 14:50:43+05:00, gluh@stripped +9 -0
    Bug#20922 mysql removes a name of first column in a table
    test case

  sql/table.cc@stripped, 2006-09-11 14:50:43+05:00, gluh@stripped +15 -1
    Bug#20922 mysql removes a name of first column in a table
    Replace all ',' symbols with NAMES_SEP_CHAR in interval names.

  sql/unireg.cc@stripped, 2006-09-11 14:50:43+05:00, gluh@stripped +15 -0
    Bug#20922 mysql removes a name of first column in a table
    if NAMES_SEP_CHAR symbols are present in interval name
    then replace all NAMES_SEP_CHAR symbols with ','

# 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:	gluh
# Host:	gluh.(none)
# Root:	/home/gluh/MySQL/Merge/4.1-kt

--- 1.137/sql/table.cc	2006-09-11 14:50:52 +05:00
+++ 1.138/sql/table.cc	2006-09-11 14:50:52 +05:00
@@ -387,7 +387,21 @@
                                                         count)))
         goto err_not_open;
       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.49/sql/unireg.cc	2006-09-11 14:50:52 +05:00
+++ 1.50/sql/unireg.cc	2006-09-11 14:50:52 +05:00
@@ -637,6 +637,21 @@
 	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.25/mysql-test/r/type_enum.result	2006-09-11 14:50:52 +05:00
+++ 1.26/mysql-test/r/type_enum.result	2006-09-11 14:50:52 +05:00
@@ -1745,3 +1745,12 @@
 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,
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;

--- 1.15/mysql-test/t/type_enum.test	2006-09-11 14:50:52 +05:00
+++ 1.16/mysql-test/t/type_enum.test	2006-09-11 14:50:52 +05:00
@@ -127,4 +127,13 @@
 alter table t1 alter a set default 'z';
 drop table t1;
 
+
+#
+# Bug#20922 mysql removes a name of first column in a table
+#
+create table t1 (f1 int);
+alter table t1 add f2 enum(0xFFFF);
+show create table t1;
+drop table t1;
+
 # End of 4.1 tests
Thread
bk commit into 4.1 tree (gluh:1.2549) BUG#20922gluh11 Sep