List:Commits« Previous MessageNext Message »
From:Tatjana A Nuernberg Date:February 12 2007 1:32pm
Subject:bk commit into 5.0 tree (tnurnberg:1.2352)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of tnurnberg. When tnurnberg 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-02-12 14:32:06+01:00, tnurnberg@stripped +3 -0
  Merge mysql.com:/home/tnurnberg/24660/41-24660
  into  mysql.com:/home/tnurnberg/24660/50-24660
  MERGE: 1.1616.2867.32

  mysql-test/r/type_enum.result@stripped, 2007-02-12 14:32:03+01:00, tnurnberg@stripped +0 -0
    Auto merged
    MERGE: 1.24.1.3

  sql/table.cc@stripped, 2007-02-12 14:32:03+01:00, tnurnberg@stripped +0 -0
    Auto merged
    MERGE: 1.111.4.10

  sql/unireg.cc@stripped, 2007-02-12 14:32:03+01:00, tnurnberg@stripped +0 -0
    Auto merged
    MERGE: 1.43.1.9

# 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:	tnurnberg
# Host:	sin.azundris.com
# Root:	/home/tnurnberg/24660/50-24660/RESYNC

--- 1.240/sql/table.cc	2006-12-01 13:02:51 +01:00
+++ 1.241/sql/table.cc	2007-02-12 14:32:03 +01:00
@@ -471,17 +471,6 @@
       {
         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.78/sql/unireg.cc	2006-11-20 21:41:56 +01:00
+++ 1.79/sql/unireg.cc	2007-02-12 14:32:03 +01:00
@@ -714,29 +714,48 @@
     {
       if (field->interval_id > int_count)
       {
-	int_count=field->interval_id;
-	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++)
+        unsigned char  sep= 0;
+        unsigned char  occ[256];
+        uint           i;
+        unsigned char *val= NULL;
+
+        bzero(occ, sizeof(occ));
+
+        for (i=0; (val= (unsigned char*) field->interval->type_names[i]); i++)
+          for (uint j = 0; j < field->interval->type_lengths[i]; j++)
+            occ[(unsigned int) (val[j])]= 1;
+
+        if (!occ[(unsigned char)NAMES_SEP_CHAR])
+          sep= (unsigned char) NAMES_SEP_CHAR;
+        else if (!occ[(unsigned int)','])
+          sep= ',';
+        else
+        {
+          for (uint i=1; i<256; i++)
           {
-            char c= val[cnt];
-            if (c == NAMES_SEP_CHAR)
-              val[cnt]= ',';
+            if(!occ[i])
+            {
+              sep= i;
+              break;
+            }
           }
-	  tmp.append(*pos);
-	  tmp.append(NAMES_SEP_CHAR);
-	}
-	tmp.append('\0');			// End of intervall
+
+          if(!sep)    /* disaster, enum uses all characters, none left as separator */
+          {
+            my_message(ER_WRONG_FIELD_TERMINATORS,ER(ER_WRONG_FIELD_TERMINATORS),
+                       MYF(0));
+            DBUG_RETURN(1);
+          }
+        }
+
+        int_count= field->interval_id;
+        tmp.append(sep);
+        for (const char **pos=field->interval->type_names ; *pos ; pos++)
+        {
+          tmp.append(*pos);
+          tmp.append(sep);
+        }
+        tmp.append('\0');                      // End of intervall
       }
     }
     if (my_write(file,(byte*) tmp.ptr(),tmp.length(),MYF_RW))

--- 1.28/mysql-test/r/type_enum.result	2006-10-12 10:48:36 +02:00
+++ 1.29/mysql-test/r/type_enum.result	2007-02-12 14:32:03 +01:00
@@ -1754,3 +1754,28 @@
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 drop table t1;
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1(denormal enum('E','F','E,F','F,E') NOT NULL DEFAULT'E');
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `denormal` enum('E','F','E,F','F,E') NOT NULL default 'E'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
+create table t1(exhausting_charset enum('ABCDEFGHIJKLMNOPQRSTUVWXYZ','	
+
+ERROR 42000: Field separator argument is not what is expected; check the manual
+End of 4.1 tests
Thread
bk commit into 5.0 tree (tnurnberg:1.2352)Tatjana A Nuernberg12 Feb