[MDEV-10052] Illegal mix of collations with DAYNAME(date_field)<>varchar_field Created: 2016-05-10  Updated: 2016-06-29  Resolved: 2016-05-10

Status: Closed
Project: MariaDB Server
Component/s: Character Sets
Affects Version/s: 5.5, 10.0, 10.1
Fix Version/s: 5.5.50, 10.0.26, 10.1.15

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None


 Description   

DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c VARCHAR(8) CHARACTER SET latin1, d DATE);
INSERT INTO t1 VALUES ('test',now());
SELECT * FROM t1 WHERE DAYNAME(d)<>c;

returns an error:

ERROR 1267 (HY000): Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_swedish_ci,IMPLICIT) for operation '<>'

It should work without errors.

The same problem is repeatable with MONTHNAME:

DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c VARCHAR(8) CHARACTER SET latin1, d DATE);
INSERT INTO t1 VALUES ('test',now());
SELECT * FROM t1 WHERE MONTHNAME(d)<>c;


Generated at Thu Feb 08 07:39:18 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.