summaryrefslogtreecommitdiff
path: root/mysql-test/r/create.result
diff options
context:
space:
mode:
authorunknown <evgen@moonbone.local>2005-08-30 16:19:53 +0400
committerunknown <evgen@moonbone.local>2005-08-30 16:19:53 +0400
commitf118f3ebaa587e4d81fc8bc622e071117a0501d4 (patch)
tree16edb78ed35954aaea1fb2952d968d34154e5c27 /mysql-test/r/create.result
parent5ea5fab40da420c19ab4a1f4b0c963c0ebb99b93 (diff)
downloadmariadb-git-f118f3ebaa587e4d81fc8bc622e071117a0501d4.tar.gz
Fix bug #12537 UNION produces longtext instead of varchar
Item::tmp_table_field_from_field_type() and create_tmp_field_from_item() was converting string field to blob depending on byte-wise length instead of character length, which results in converting valid varchar string with length == 86 to longtext. Made that functions above take into account max width of character when converting string fields to blobs. sql/item.cc: Fix bug #12537 UNION produces longtext instead of varchar Item::tmp_table_field_from_field_type() now taking into account max char width when creating tmp field for string fields. sql/sql_select.cc: Fix bug #12537 UNION produces longtext instead of varchar create_tmp_field_from_item()now taking into account max char width when creating tmp field for string fields. mysql-test/r/create.result: Test case for bug #12537 UNION produces longtext instead of varchar mysql-test/t/create.test: Test case for bug #12537 UNION produces longtext instead of varchar
Diffstat (limited to 'mysql-test/r/create.result')
-rw-r--r--mysql-test/r/create.result7
1 files changed, 7 insertions, 0 deletions
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index 00bc0320028..95757fbd7dc 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -580,6 +580,13 @@ ERROR 42000: Incorrect database name 'xyz'
create table t1(t1.name int);
create table t2(test.t2.name int);
drop table t1,t2;
+CREATE TABLE t1 (f1 VARCHAR(255) CHARACTER SET utf8);
+CREATE TABLE t2 AS SELECT LEFT(f1,86) AS f2 FROM t1 UNION SELECT LEFT(f1,86)
+AS f2 FROM t1;
+DESC t2;
+Field Type Null Key Default Extra
+f2 varchar(86) YES NULL
+DROP TABLE t1,t2;
create database mysqltest;
use mysqltest;
drop database mysqltest;