An unexpected 'Illegal mix of collations' pops up when comparing result of CASE expression with a field (CASE expression returns either 'Y' or NULL). According to Bar, this
should not happen.
To reproduce :
MariaDB [test]> CREATE TABLE `datatypetestm` (CCHAR1 char(1));
Query OK, 0 rows affected (0.00 sec)
MariaDB [test]> select CCHAR1 from datatypetestm where CASE CCHAR1 WHEN 'aaaa' THEN 'Y' WHEN 'aaaa' THEN 'Y' ELSE NULL END <> CCHAR1;
ERROR 1267 (HY000): Illegal mix of collations (cp850_general_ci,COERCIBLE) and (latin1_swedish_ci,IMPLICIT) for operation '<>'