mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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: Fixed an earlier test case plus added two new tests. mysql-test/t/union.test: Fixed an earlier test case plus added two new tests.
This commit is contained in:
@ -1283,10 +1283,39 @@ 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)` 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;
|
||||
|
Reference in New Issue
Block a user