MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:bar Date:March 1 2006 1:58pm
Subject:bk commit into 4.1 tree (bar:1.2475) BUG#15949
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of bar. When bar 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
  1.2475 06/03/01 17:58:01 bar@stripped +3 -0
    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.

  mysql-test/r/union.result
    1.95 06/03/01 17:54:56 bar@stripped +11 -1
    Adding test case.

  mysql-test/t/union.test
    1.89 06/03/01 17:54:50 bar@stripped +10 -1
    Adding test case.

  sql/item.cc
    1.231 06/03/01 17:53:13 bar@stripped +1 -1
    Allow character set conversion in UNION
    - string to column's charset
    - to unicode
    Bug#15949 union + illegal mix of collations (IMPLICIT + COERCIBLE)

# 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:	bar
# Host:	bar.intranet.mysql.r18.ru
# Root:	/usr/home/bar/mysql-4.1

--- 1.230/sql/item.cc	2005-11-29 23:52:56 +04:00
+++ 1.231/sql/item.cc	2006-03-01 17:53:13 +04:00
@@ -3258,7 +3258,7 @@
     const char *old_cs, *old_derivation;
     old_cs= collation.collation->name;
     old_derivation= collation.derivation_name();
-    if (collation.aggregate(item->collation))
+    if (collation.aggregate(item->collation, MY_COLL_ALLOW_CONV))
     {
       my_error(ER_CANT_AGGREGATE_2COLLATIONS, MYF(0),
 	       old_cs, old_derivation,

--- 1.94/mysql-test/r/union.result	2005-10-29 06:12:48 +05:00
+++ 1.95/mysql-test/r/union.result	2006-03-01 17:54:56 +04:00
@@ -1185,6 +1185,16 @@
 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 (
 b ENUM("one", "two") character set utf8,
@@ -1214,7 +1224,7 @@
 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

--- 1.88/mysql-test/t/union.test	2005-10-29 06:12:48 +05:00
+++ 1.89/mysql-test/t/union.test	2006-03-01 17:54:50 +04:00
@@ -711,6 +711,15 @@
 select concat('value is: ', @val) union select 'some text';
 
 #
+# Bug#15949 union + illegal mix of collations (IMPLICIT + COERCIBLE)
+#
+select concat(_latin1'a', _ascii'b' collate ascii_bin);
+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;
+drop table t1;
+
+#
 # Enum merging test
 #
 CREATE TABLE t1 (
@@ -729,8 +738,8 @@
 create table t2 select a from t1 union select a from t1;
 show columns from t2;
 drop table t2;
--- error 1267
 create table t2 select a from t1 union select c from t1;
+drop table t2;
 create table t2 select a from t1 union select b from t1;
 show columns from t2;
 drop table t2, t1;
Thread
bk commit into 4.1 tree (bar:1.2475) BUG#15949bar1 Mar