MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:msvensson Date:December 7 2005 2:45pm
Subject:bk commit into 4.1 tree (msvensson:1.2485) BUG#9535
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of msvensson. When msvensson 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.2485 05/12/07 15:45:31 msvensson@neptunus.(none) +3 -0
  BUG#9535 Warning for "create table t as select uuid();"
     - Set max_length of Item_func_uuid to max_length*system_charset_info->mbmaxlen
      Note! Item_func_uuid should be set to use 'ascii' charset when hex(), format(), md5()
  etc will use 'ascii'
      - Comitting again, the old patch seems to have been lost.

  sql/item_strfunc.h
    1.100 05/12/07 15:45:28 msvensson@neptunus.(none) +6 -1
    Multiply max_length of Item_func_uuid with system_charset_info->mbmaxlen

  mysql-test/t/func_misc.test
    1.13 05/12/07 15:45:28 msvensson@neptunus.(none) +5 -0
    Test case

  mysql-test/r/func_misc.result
    1.17 05/12/07 15:45:28 msvensson@neptunus.(none) +8 -0
    Test results updated

# 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:	msvensson
# Host:	neptunus.(none)
# Root:	/home/msvensson/mysql/bug9535/my41-bug9535

--- 1.99/sql/item_strfunc.h	2005-11-21 14:22:56 +01:00
+++ 1.100/sql/item_strfunc.h	2005-12-07 15:45:28 +01:00
@@ -748,7 +748,12 @@
   Item_func_uuid(): Item_str_func() {}
   void fix_length_and_dec() {
     collation.set(system_charset_info);
-    max_length= UUID_LENGTH;
+    /*
+       NOTE! uuid() should be changed to use 'ascii'
+       charset when hex(), format(), md5(), etc, and implicit
+       number-to-string conversion will use 'ascii'
+    */
+    max_length= UUID_LENGTH * system_charset_info->mbmaxlen;
   }
   const char *func_name() const{ return "uuid"; }
   String *val_str(String *);

--- 1.16/mysql-test/r/func_misc.result	2005-02-04 07:14:20 +01:00
+++ 1.17/mysql-test/r/func_misc.result	2005-12-07 15:45:28 +01:00
@@ -49,3 +49,11 @@
 a
 2004-01-06 12:34:00
 drop table t1;
+create table t1 as select uuid(), length(uuid());
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `uuid()` char(36) character set utf8 NOT NULL default '',
+  `length(uuid())` int(10) NOT NULL default '0'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;

--- 1.12/mysql-test/t/func_misc.test	2005-07-28 02:21:42 +02:00
+++ 1.13/mysql-test/t/func_misc.test	2005-12-07 15:45:28 +01:00
@@ -38,4 +38,9 @@
 
 drop table t1;
 
+# Test for BUG#9535
+create table t1 as select uuid(), length(uuid());
+show create table t1;
+drop table t1;
+
 # End of 4.1 tests
Thread
bk commit into 4.1 tree (msvensson:1.2485) BUG#9535msvensson7 Dec