List:Internals« Previous MessageNext Message »
From:sanja Date:May 23 2005 3:50pm
Subject:bk commit into 4.1 tree (bell:1.2288) BUG#10025
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of bell. When bell 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.2288 05/05/23 16:50:45 bell@stripped +3 -0
  fixed problem with long string results of expressions in UNIONS (BUG#10025)

  sql/item.cc
    1.203 05/05/23 16:50:42 bell@stripped +5 -3
    set HA_OPTION_PACK_RECORD and change type to MYSQL_TYPE_STRING, to allow correct field creation in case of length more then 255 (creation STRING field with length more then 255)

  mysql-test/t/union.test
    1.84 05/05/23 16:50:42 bell@stripped +9 -0
    test for Bug #10025

  mysql-test/r/union.result
    1.90 05/05/23 16:50:42 bell@stripped +8 -0
    test for Bug #10025

# 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:	bell
# Host:	sanja.is.com.ua
# Root:	/home/bell/mysql/bk/work-4.1

--- 1.202/sql/item.cc	Mon May 16 12:18:53 2005
+++ 1.203/sql/item.cc	Mon May 23 16:50:42 2005
@@ -3098,9 +3098,11 @@
                          table, get_set_pack_length(enum_set_typelib->count),
                          enum_set_typelib, collation.collation);
   case MYSQL_TYPE_VAR_STRING:
-    table->db_create_options|= HA_OPTION_PACK_RECORD;
-    return new Field_string(max_length, maybe_null, name, table,
-                            collation.collation);
+    /* If it will not be converted to TEXT we will use packed records */
+    if (max_length < 255)
+      table->db_create_options|= HA_OPTION_PACK_RECORD;
+    fld_type= MYSQL_TYPE_STRING;
+    break;
   default:
     break;
   }

--- 1.89/mysql-test/r/union.result	Sun Apr 10 10:40:13 2005
+++ 1.90/mysql-test/r/union.result	Mon May 23 16:50:42 2005
@@ -1235,3 +1235,11 @@
 Field	Type	Null	Key	Default	Extra
 a	varchar(3)	YES		NULL	
 drop table t2, t1;
+CREATE TABLE t1 (a mediumtext);
+CREATE TABLE t2 (b varchar(20));
+INSERT INTO t1 VALUES ('a'),('b');
+SELECT left(a,100000000) FROM t1 UNION  SELECT b FROM t2;
+left(a,100000000)
+a
+b
+drop tables t1,t2;

--- 1.83/mysql-test/t/union.test	Sun Apr 10 10:40:05 2005
+++ 1.84/mysql-test/t/union.test	Mon May 23 16:50:42 2005
@@ -742,3 +742,12 @@
 create table t2 select a from t1 union select b from t1;
 show columns from t2;
 drop table t2, t1;
+
+#
+# correct conversion long string to TEXT (BUG#10025)
+#
+CREATE TABLE t1 (a mediumtext);
+CREATE TABLE t2 (b varchar(20));
+INSERT INTO t1 VALUES ('a'),('b');
+SELECT left(a,100000000) FROM t1 UNION  SELECT b FROM t2;
+drop tables t1,t2;
Thread
bk commit into 4.1 tree (bell:1.2288) BUG#10025sanja23 May