Bug #57385 CREATE TABLE default COLLATE/CHARACTER SET depends on order
Submitted: 11 Oct 2010 21:30 Modified: 13 Apr 2018 4:03
Reporter: Milan Crha Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Charsets Severity:S3 (Non-critical)
Version:5.0, 5.1, 5.6.99 OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[11 Oct 2010 21:30] Milan Crha
Description:
I realized when using a CREATE TABLE with COLLATE and CHARACTER SET options then it depends on the order of those two options what will be the result. I do not think it should depend on the order of them, the result should be always the same.

How to repeat:
mysql> create table tt (str varchar(10)) character set=cp1250 collate=cp1250_czech_cs;
Query OK, 0 rows affected (0.03 sec)

mysql> show table status LIKE 'tt';
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+--------------------
-+---------------------+------------+-----------------+----------+----------------+---------+
| Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time
 | Update_time         | Check_time | Collation       | Checksum | Create_options | Comment |
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+--------------------
-+---------------------+------------+-----------------+----------+----------------+---------+
| tt   | MyISAM |      10 | Dynamic    |    0 |              0 |           0 | 281474976710655 |         1024 |         0 |           NULL | 2010-10-11 22:34:30
 | 2010-10-11 22:34:30 | NULL       | cp1250_czech_cs |     NULL |                |         |
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+--------------------
-+---------------------+------------+-----------------+----------+----------------+---------+
1 row in set (0.00 sec)

See above correct collation, but below:

mysql> drop table tt;
Query OK, 0 rows affected (0.00 sec)

mysql> create table tt (str varchar(10)) collate=cp1250_czech_cs character set=cp1250;
Query OK, 0 rows affected (0.02 sec)

mysql> show table status LIKE 'tt';
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+--------------------
-+---------------------+------------+-------------------+----------+----------------+---------+
| Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time
 | Update_time         | Check_time | Collation         | Checksum | Create_options | Comment |
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+--------------------
-+---------------------+------------+-------------------+----------+----------------+---------+
| tt   | MyISAM |      10 | Dynamic    |    0 |              0 |           0 | 281474976710655 |         1024 |         0 |           NULL | 2010-10-11 22:35:17
 | 2010-10-11 22:35:17 | NULL       | cp1250_general_ci |     NULL |                |         |
+------+--------+---------+------------+------+----------------+-------------+-----------------+--------------+-----------+----------------+--------------------
-+---------------------+------------+-------------------+----------+----------------+---------+
1 row in set (0.00 sec)
[12 Oct 2010 8:43] Sveta Smirnova
Thank you for the report.

Verified as described. This should be specified in user manual at least.
[15 Nov 2016 18:58] monty solomon
This bug appears to be a duplicate of bug 32571.
[13 Apr 2018 4:03] Erlend Dahl
Duplicate of

Bug#32571 CREATE TABLE options are dependant on the order of specification