[MDEV-10181] Illegal mix of collation for a field and an ASCII string as a view field Created: 2016-06-06  Updated: 2016-06-10  Resolved: 2016-06-10

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

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

Sprint: 5.5.50

 Description   

This problem was originally reported by email by David Hall.

This script:

SET NAMES utf8;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1);
DROP VIEW v1;
CREATE VIEW v1 AS SELECT 'a';
SELECT * FROM v1,t1 where t1.a=v1.a;

returns an error:

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

This is wrong. The string constant in the view is pure ASCII so it can be safely converted to the character set of the field.


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