List:Commits« Previous MessageNext Message »
From:jani Date:September 26 2006 12:19pm
Subject:bk commit into 5.1 tree (jani:1.2326) BUG#10025
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of jani. When jani 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, 2006-09-26 13:19:25+03:00, jani@stripped +2
-0
  Fix for bug#20208
  A better fix for bug#10025.
  
  Fixed test case plus added new tests.
  
  After fixing Bug#20208 "Blobs greater than 8K are being truncated to 8K"
  the fix to bug#10025 "Misleading error with COLLATE mediumtext and UNION"
  became more accurate. Earlier mediumtext got converted to longtext,
  although mediumtext was enough to contain the results. Now it converts
  correctly to mediumtext, if the length does not exceed that and if none
  of the original fields were type longtext.
  
  Type longtext still converts correctly to type longtext, as the extra
  tests prove.

  mysql-test/r/union.result@stripped, 2006-09-26 13:19:21+03:00,
jani@stripped +29 -0
    Fixed an earlier test case plus added two new tests.

  mysql-test/t/union.test@stripped, 2006-09-26 13:19:21+03:00,
jani@stripped +30 -0
    Fixed an earlier test case plus added two new tests.

# 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:	jani
# Host:	a88-112-41-254.elisa-laajakaista.fi
# Root:	/home/jani/mysql-5.1-bug-20208

--- 1.90/mysql-test/r/union.result	2006-09-26 13:19:32 +03:00
+++ 1.91/mysql-test/r/union.result	2006-09-26 13:19:32 +03:00
@@ -1284,9 +1284,38 @@
 show create table t3;
 Table	Create Table
 t3	CREATE TABLE `t3` (
+  `left(a,100000000)` mediumtext
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop tables t1,t2,t3;
+CREATE TABLE t1 (a longtext);
+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
+create table t3 SELECT left(a,100000000) FROM t1 UNION  SELECT b FROM t2;
+show create table t3;
+Table	Create Table
+t3	CREATE TABLE `t3` (
   `left(a,100000000)` longtext
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 drop tables t1,t2,t3;
+SELECT @tmp_max:= @@max_allowed_packet;
+@tmp_max:= @@max_allowed_packet
+1048576
+SET max_allowed_packet=25000000;
+CREATE TABLE t1 (a mediumtext);
+CREATE TABLE t2 (b varchar(20));
+INSERT INTO t1 VALUES ('a');
+CREATE TABLE t3 SELECT REPEAT(a,20000000) AS a FROM t1 UNION SELECT b FROM t2;
+SHOW CREATE TABLE t3;
+Table	Create Table
+t3	CREATE TABLE `t3` (
+  `a` longtext
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLES t1,t2,t3;
+SET max_allowed_packet:= @tmp_max;
 create table t1 ( id int not null auto_increment, primary key (id), col1 int);
 insert into t1 (col1) values (2),(3),(4),(5),(6);
 select 99 union all select id from t1 order by 1;

--- 1.97/mysql-test/t/union.test	2006-09-26 13:19:32 +03:00
+++ 1.98/mysql-test/t/union.test	2006-09-26 13:19:32 +03:00
@@ -774,6 +774,7 @@
 #
 # 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');
@@ -781,6 +782,35 @@
 create table t3 SELECT left(a,100000000) FROM t1 UNION  SELECT b FROM t2;
 show create table t3;
 drop tables t1,t2,t3;
+
+#
+# Extended fix to Bug#10025 - the test above should result to mediumtext
+# and the one below to longtext. Earlier above test resulted to longtext
+# type also.
+#
+
+CREATE TABLE t1 (a longtext);
+CREATE TABLE t2 (b varchar(20));
+INSERT INTO t1 VALUES ('a'),('b');
+SELECT left(a,100000000) FROM t1 UNION  SELECT b FROM t2;
+create table t3 SELECT left(a,100000000) FROM t1 UNION  SELECT b FROM t2;
+show create table t3;
+drop tables t1,t2,t3;
+
+#
+# Testing here that mediumtext converts into longtext if the result
+# exceeds mediumtext maximum length
+#
+
+SELECT @tmp_max:= @@max_allowed_packet;
+SET max_allowed_packet=25000000;
+CREATE TABLE t1 (a mediumtext);
+CREATE TABLE t2 (b varchar(20));
+INSERT INTO t1 VALUES ('a');
+CREATE TABLE t3 SELECT REPEAT(a,20000000) AS a FROM t1 UNION SELECT b FROM t2;
+SHOW CREATE TABLE t3;
+DROP TABLES t1,t2,t3;
+SET max_allowed_packet:= @tmp_max;
 
 #
 # Bug #10032 Bug in parsing UNION with ORDER BY when one node does not use FROM
Thread
bk commit into 5.1 tree (jani:1.2326) BUG#10025jani26 Sep