Description:
mysql> set names latin5;
Query OK, 0 rows affected (0.00 sec)
mysql> SET @DATE1='1900-01-01';
Query OK, 0 rows affected (0.00 sec)
mysql> SET @DATE2=CURDATE();
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT @DATE1>@DATE2;
ERROR 1267 (HY000): Illegal mix of collations (latin5_turkish_ci,IMPLICIT) and (
latin1_swedish_ci,IMPLICIT) for operation '>'
mysql> select charset(@DATE1),charset(@DATE2); ## on mysql 5.6.17
.+-----------------+-----------------+
| charset(@DATE1) | charset(@DATE2) |
+-----------------+-----------------+
| latin5 | latin1 |
+-----------------+-----------------+
1 row in set (0.00 sec)
mysql> select charset(@DATE1),charset(@DATE2); ## on mysql 5.1.70
.+-----------------+-----------------+
| charset(@DATE1) | charset(@DATE2) |
+-----------------+-----------------+
| latin5 | binary |
+-----------------+-----------------+
1 row in set (0.00 sec)
mysql> SHOW VARIABLES LIKE "%CHARACTER%";
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | latin5 |
| character_set_connection | latin5 |
| character_set_database | latin5 |
| character_set_filesystem | latin5 |
| character_set_results | latin5 |
| character_set_server | latin5 |
| character_set_system | utf8 |
| character_sets_dir | D:\eskom56\share\charsets\ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)
How to repeat:
mysql> set names latin5;
Query OK, 0 rows affected (0.00 sec)
mysql> SET @DATE1='1900-01-01';
Query OK, 0 rows affected (0.00 sec)
mysql> SET @DATE2=CURDATE();
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT @DATE1>@DATE2;
ERROR 1267 (HY000): Illegal mix of collations (latin5_turkish_ci,IMPLICIT) and (
latin1_swedish_ci,IMPLICIT) for operation '>'
mysql> select charset(@DATE1),charset(@DATE2); ## on mysql 5.6.17
.+-----------------+-----------------+
| charset(@DATE1) | charset(@DATE2) |
+-----------------+-----------------+
| latin5 | latin1 |
+-----------------+-----------------+
1 row in set (0.00 sec)
mysql> select charset(@DATE1),charset(@DATE2); ## on mysql 5.1.70
.+-----------------+-----------------+
| charset(@DATE1) | charset(@DATE2) |
+-----------------+-----------------+
| latin5 | binary |
+-----------------+-----------------+
1 row in set (0.00 sec)
mysql> SHOW VARIABLES LIKE "%CHARACTER%";
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | latin5 |
| character_set_connection | latin5 |
| character_set_database | latin5 |
| character_set_filesystem | latin5 |
| character_set_results | latin5 |
| character_set_server | latin5 |
| character_set_system | utf8 |
| character_sets_dir | D:\eskom56\share\charsets\ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)