diff options
author | jani@a88-112-41-254.elisa-laajakaista.fi <> | 2006-09-26 13:19:25 +0300 |
---|---|---|
committer | jani@a88-112-41-254.elisa-laajakaista.fi <> | 2006-09-26 13:19:25 +0300 |
commit | 4bfe83d5d1272738dd49dd8a187784d79e6033a5 (patch) | |
tree | f2d09d05c37f785d2d46a0dcb043b95a399a60f7 /mysql-test/t/union.test | |
parent | 98e224eb128a8a022ba1f171335f79d27d025433 (diff) | |
download | mariadb-git-4bfe83d5d1272738dd49dd8a187784d79e6033a5.tar.gz |
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.
Diffstat (limited to 'mysql-test/t/union.test')
-rw-r--r-- | mysql-test/t/union.test | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index bf5c5e066f0..b510877d23d 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -774,6 +774,7 @@ drop table t1,t2; # # 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'); @@ -783,6 +784,35 @@ 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 # |