List:Commits« Previous MessageNext Message »
From:Alexander Barkov Date:August 18 2010 1:13pm
Subject:bzr commit into mysql-next-mr-bugfixing branch (bar:3224)
View as plain text  
#At file:///home/bar/mysql-bzr/mysql-next-mr-bugfixing/ based on revid:li-bing.song@stripped

 3224 Alexander Barkov	2010-08-18 [merge]
      Merging from mysql-trunk-bugfixing.

    modified:
      mysql-test/r/ctype_utf32.result
      mysql-test/t/ctype_utf32.test
      sql/item_strfunc.cc
      sql/item_strfunc.h
=== modified file 'mysql-test/r/ctype_utf32.result'
--- a/mysql-test/r/ctype_utf32.result	2010-08-09 13:32:04 +0000
+++ b/mysql-test/r/ctype_utf32.result	2010-08-18 13:12:18 +0000
@@ -1091,6 +1091,15 @@ t2	CREATE TABLE `t2` (
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 DROP TABLE t1, t2;
 #
+# Bug#45263 utf32_general_ci, bad effects around CREATE TABLE AS SELECT
+#
+SET collation_connection=utf32_general_ci;
+CREATE TABLE t1 AS SELECT HEX(0x00) AS my_col;
+SELECT * FROM t1;
+my_col
+00
+DROP TABLE t1;
+#
 # Bug#32859 Character sets: no warning with non-fitting chariot wheel
 #
 DROP TABLE IF EXISTS t1;

=== modified file 'mysql-test/t/ctype_utf32.test'
--- a/mysql-test/t/ctype_utf32.test	2010-08-09 13:32:04 +0000
+++ b/mysql-test/t/ctype_utf32.test	2010-08-18 13:12:18 +0000
@@ -800,6 +800,15 @@ CREATE TABLE t2 AS SELECT CONCAT(s1) FRO
 SHOW CREATE TABLE t2;
 DROP TABLE t1, t2;
 
+
+--echo #
+--echo # Bug#45263 utf32_general_ci, bad effects around CREATE TABLE AS SELECT
+--echo #
+SET collation_connection=utf32_general_ci;
+CREATE TABLE t1 AS SELECT HEX(0x00) AS my_col;
+SELECT * FROM t1;
+DROP TABLE t1;
+
 --echo #
 --echo # Bug#32859 Character sets: no warning with non-fitting chariot wheel
 --echo #

=== modified file 'sql/item_strfunc.cc'
--- a/sql/item_strfunc.cc	2010-07-13 17:29:44 +0000
+++ b/sql/item_strfunc.cc	2010-08-18 13:12:18 +0000
@@ -3136,7 +3136,7 @@ nl:
 }
 
 
-String *Item_func_hex::val_str(String *str)
+String *Item_func_hex::val_str_ascii(String *str)
 {
   String *res;
   DBUG_ASSERT(fixed == 1);
@@ -3175,6 +3175,7 @@ String *Item_func_hex::val_str(String *s
   }
   null_value=0;
   tmp_value.length(res->length()*2);
+  tmp_value.set_charset(&my_charset_latin1);
 
   octet2hex((char*) tmp_value.ptr(), res->ptr(), res->length());
   return &tmp_value;

=== modified file 'sql/item_strfunc.h'
--- a/sql/item_strfunc.h	2010-07-13 17:29:44 +0000
+++ b/sql/item_strfunc.h	2010-08-18 13:12:18 +0000
@@ -622,18 +622,18 @@ public:
 };
 
 
-class Item_func_hex :public Item_str_func
+class Item_func_hex :public Item_str_ascii_func
 {
   String tmp_value;
 public:
-  Item_func_hex(Item *a) :Item_str_func(a) {}
+  Item_func_hex(Item *a) :Item_str_ascii_func(a) {}
   const char *func_name() const { return "hex"; }
-  String *val_str(String *);
+  String *val_str_ascii(String *);
   void fix_length_and_dec()
   {
     collation.set(default_charset());
     decimals=0;
-    max_length=args[0]->max_length*2*collation.collation->mbmaxlen;
+    fix_char_length(args[0]->max_length * 2);
   }
 };
 


Attachment: [text/bzr-bundle] bzr/bar@mysql.com-20100818131218-uhbw4id2t7q1u1va.bundle
Thread
bzr commit into mysql-next-mr-bugfixing branch (bar:3224) Alexander Barkov18 Aug