List:Commits« Previous MessageNext Message »
From:gluh Date:January 18 2006 12:30pm
Subject:bk commit into 4.1 tree (gluh:1.2483) BUG#15316
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
  1.2483 06/01/18 16:30:41 gluh@stripped +3 -0
  Fix for bug#15316 SET value having comma not correctly handled(2nd ver)
   to disallow the use of comma in SET members

  sql/sql_table.cc
    1.308 06/01/18 16:30:37 gluh@stripped +17 -0
    Fix for bug#15316 SET value having comma not correctly handled(2nd ver)
     to disallow the use of comma in SET members

  mysql-test/t/create.test
    1.65 06/01/18 16:30:37 gluh@stripped +6 -0
    Fix for bug#15316 SET value having comma not correctly handled(2nd ver)
     test case

  mysql-test/r/create.result
    1.91 06/01/18 16:30:37 gluh@stripped +2 -0
    Fix for bug#15316 SET value having comma not correctly handled(2nd ver)
     test result

# 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:	eagle.intranet.mysql.r18.ru
# Root:	/home/gluh/MySQL/Bugs/4.1.15316

--- 1.307/sql/sql_table.cc	Fri Nov 25 14:25:25 2005
+++ 1.308/sql/sql_table.cc	Wed Jan 18 16:30:37 2006
@@ -553,6 +553,23 @@ int mysql_prepare_table(THD *thd, HA_CRE
                                             interval->type_lengths[i]);
           interval->type_lengths[i]= lengthsp;
           ((uchar *)interval->type_names[i])[lengthsp]= '\0';
+          if (sql_field->sql_type == FIELD_TYPE_SET)
+          {
+            char comma_buf[2];
+            int comma_length= cs->cset->wc_mb(cs, ',', (uchar*) comma_buf,
+                                              (uchar*) comma_buf + 
+                                              sizeof(comma_buf));
+            DBUG_ASSERT(comma_length > 0);
+            if (cs->coll->instr(cs, interval->type_names[i], 
+                                interval->type_lengths[i], 
+                                comma_buf, comma_length, NULL, 0))
+            {
+              my_printf_error(ER_UNKNOWN_ERROR,
+                              "Illegal %s '%-.64s' value found during parsing",
+                              MYF(0), "set", tmp->ptr());
+              DBUG_RETURN(-1);
+            }
+          }
         }
         sql_field->interval_list.empty(); // Don't need interval_list anymore
       }

--- 1.90/mysql-test/r/create.result	Wed Dec  7 22:54:06 2005
+++ 1.91/mysql-test/r/create.result	Wed Jan 18 16:30:37 2006
@@ -694,3 +694,5 @@ t2	CREATE TABLE `t2` (
   `a2` int(11) default NULL
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 drop table t1, t2;
+create table t1(a set("a,b","c,d") not null);
+ERROR HY000: Illegal set 'a,b' value found during parsing

--- 1.64/mysql-test/t/create.test	Wed Dec  7 22:54:06 2005
+++ 1.65/mysql-test/t/create.test	Wed Jan 18 16:30:37 2006
@@ -596,4 +596,10 @@ show create table t2;
 
 drop table t1, t2;
 
+#
+# Bug #15316 SET value having comma not correctly handled
+#
+--error 1105
+create table t1(a set("a,b","c,d") not null);
+
 # End of 4.1 tests
Thread
bk commit into 4.1 tree (gluh:1.2483) BUG#15316gluh18 Jan