Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.5(EOL), 10.0(EOL), 10.1(EOL)
Description
SET NAMES utf8;
|
DROP TABLE IF EXISTS t1;
|
DROP VIEW IF EXISTS v1;
|
CREATE TABLE t1 (col1 VARCHAR(12) CHARACTER SET utf8 COLLATE utf8_unicode_ci);
|
INSERT INTO t1 VALUES ('a'),('b');
|
CREATE VIEW v1 AS SELECT group_concat('f') AS col1;
|
SELECT col1 FROM v1 UNION SELECT col1 FROM t1;
|
returns
ERROR 1271 (HY000) at line 7: Illegal mix of collations for operation 'UNION'
|
This is very similar to:
MySQL Bug#21505 Create view - illegal mix of collation for operation 'UNION'
https://bugs.mysql.com/bug.php?id=21505
which was fixed in 2006, but now for an aggregate function GROUP_CONCAT.
The problem is that create_tmp_field_from_item() in sql_select.cc and Item_sum::create_tmp_field() are exactly the same 40 lines of the code.
create_tmp_field_from_item() was fixed by Bug#21505, while Item_sum::create_tmp_field() was not.
The code in create_tmp_field_from_item() should be moved as a method in Item, and Item_sum::create_tmp_field() should just reuse it.
Attachments
Issue Links
- blocks
-
MDEV-4912 Data type plugin API version 1
- Closed