[MDEV-27853] Wrong data type on column `COLLATE DEFAULT` and table `COLLATE some_non_default_collation` Created: 2022-02-15  Updated: 2022-03-23  Resolved: 2022-03-23

Status: Closed
Project: MariaDB Server
Component/s: Character Sets
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8
Fix Version/s: 10.9.0

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

Issue Links:
Relates
relates to MDEV-27009 Add UCA-14.0.0 collations Closed
relates to MDEV-27690 Crash on `CHARACTER SET csname COLLAT... Closed
relates to MDEV-27782 Wrong columns when using table level ... Closed
relates to MDEV-28067 Multiple conflicting column COLLATE c... Closed
relates to MDEV-27743 Remove Lex::charset Closed

 Description   

CREATE OR REPLACE TABLE t1 (a CHAR(10) COLLATE DEFAULT) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
SHOW CREATE TABLE t1;

+-------+---------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                                    |
+-------+---------------------------------------------------------------------------------------------------------------------------------+
| t1    | CREATE TABLE `t1` (
  `a` char(10) COLLATE utf8mb4_bin DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+---------------------------------------------------------------------------------------------------------------------------------+

Looks wrong. The expected behaviour would be to create the column with the collation utf8mb4_general_ci, i.e. use the default collation of the column character set utf8mb4, which is inherited from the table level.

It should not inherit the collation from the table level.


Generated at Thu Feb 08 09:56:05 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.