mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
Bug#60101 COALESCE with cp1251 tables causes [Err] 1267 - Illegal mix of collations
Problem: IF() did not copy collation derivation and repertoire from an argument if the opposite argument was NULL: IF(cond, res1, NULL) IF(cond, NULL, res2) only CHARSET_INFO pointer was copied. This resulted in illegal mix of collations error. Fix: copy all collation parameters from the non-NULL argument: CHARSET_INFO pointer, derivation, repertoire.
This commit is contained in:
@@ -3219,5 +3219,20 @@ maketime(`a`,`a`,`a`)
|
||||
DROP TABLE t1;
|
||||
SET sql_mode=default;
|
||||
#
|
||||
# Bug#60101 COALESCE with cp1251 tables causes [Err] 1267 - Illegal mix of collations
|
||||
#
|
||||
CREATE TABLE t1 (test1 INT, test2 VARCHAR(255));
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`test1` int(11) DEFAULT NULL,
|
||||
`test2` varchar(255) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
SELECT COALESCE(IF(test1=1, 1, NULL), test2) FROM t1;
|
||||
COALESCE(IF(test1=1, 1, NULL), test2)
|
||||
SELECT COALESCE(IF(test1=1, NULL, 1), test2) FROM t1;
|
||||
COALESCE(IF(test1=1, NULL, 1), test2)
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 5.5 tests
|
||||
#
|
||||
|
Reference in New Issue
Block a user