From c64c108eda29fbcb397a694056708261f2891916 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 1 Mar 2006 17:58:01 +0400 Subject: Bug#15949 union + illegal mix of collations (IMPLICIT + COERCIBLE) union.result, union.test: Adding test case. item.cc: Allow safe character set conversion in UNION - string constant to column's charset - to unicode Thus, UNION now works the same with CONCAT (and other string functions) in respect of aggregating arguments with different character sets. sql/item.cc: Allow character set conversion in UNION - string to column's charset - to unicode Bug#15949 union + illegal mix of collations (IMPLICIT + COERCIBLE) mysql-test/t/union.test: Adding test case. mysql-test/r/union.result: Adding test case. --- mysql-test/r/union.result | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'mysql-test/r/union.result') diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index a9b2345d834..d01ce6249f7 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -1185,6 +1185,16 @@ select concat('value is: ', @val) union select 'some text'; concat('value is: ', @val) value is: 6 some text +select concat(_latin1'a', _ascii'b' collate ascii_bin); +concat(_latin1'a', _ascii'b' collate ascii_bin) +ab +create table t1 (foo varchar(100)) collate ascii_bin; +insert into t1 (foo) values ("foo"); +select foo from t1 union select 'bar' as foo from dual; +foo +foo +bar +drop table t1; CREATE TABLE t1 ( a ENUM('ä','ö','ü') character set utf8 not null default 'ü', b ENUM("one", "two") character set utf8, @@ -1214,7 +1224,7 @@ Field Type Null Key Default Extra a char(1) drop table t2; create table t2 select a from t1 union select c from t1; -ERROR HY000: Illegal mix of collations (utf8_general_ci,IMPLICIT) and (latin1_swedish_ci,IMPLICIT) for operation 'UNION' +drop table t2; create table t2 select a from t1 union select b from t1; show columns from t2; Field Type Null Key Default Extra -- cgit v1.2.1