Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL)
-
None
Description
It's impossible to convert a table to some character set, but at the same time set the DEFAULT character set to another character set:
ALTER TABLE t1 CONVERT TO CHARACTER SET utf8mb3, DEFAULT CHARACTER SET utf8mb4; |
ERROR 1302 (HY000): Conflicting declarations: 'CHARACTER SET utf8mb3' and 'CHARACTER SET utf8mb4'
|
The problem happens because the code handling both clauses uses HA_CREATE_INFO::default_table_charset to check conflicting declarations.
The test for conflicts was added by MDEV-7387. Before MDEV-7387 it worked even worse:
ALTER TABLE t1 CHARACTER SET utf8, CONVERT TO CHARACTER SET latin1; |
ignored the utf8 part and just use the latin1 part for both conversion and DEFAULT.
It should be fixed to allow any combinations of cs1/cl1 and cs2/cs2 in:
- [DEFAULT] CHARACTER SET cs1 [COLLATE cl1], and
- CONVERT TO CHARACTER SET cs2 [COLLATE cs2]
Attachments
Issue Links
- relates to
-
MDEV-27896 Wrong result upon `COLLATE latin1_bin CHARACTER SET latin1` on the table or the database level
- Closed
-
MDEV-28117 Multiple conflicting table COLLATE clauses are not rejected
- Closed