[MDEV-28067] Multiple conflicting column COLLATE clauses are not rejected Created: 2022-03-15  Updated: 2022-03-23  Resolved: 2022-03-23

Status: Closed
Project: MariaDB Server
Component/s: Character Sets, Data types
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9
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-27690 Crash on `CHARACTER SET csname COLLAT... Closed
relates to MDEV-27743 Remove Lex::charset Closed
relates to MDEV-27782 Wrong columns when using table level ... Closed
relates to MDEV-27853 Wrong data type on column `COLLATE DE... Closed
relates to MDEV-28117 Multiple conflicting table COLLATE cl... Closed

 Description   

If I specify mutiple conflicting COLLATE clauses on the column level, no error is raised:

CREATE OR REPLACE TABLE t1 (a CHAR(10) COLLATE latin1_swedish_ci NOT NULL COLLATE latin1_bin);
SHOW CREATE TABLE t1;

+-------+----------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                                               |
+-------+----------------------------------------------------------------------------------------------------------------------------+
| t1    | CREATE TABLE `t1` (
  `a` char(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
+-------+----------------------------------------------------------------------------------------------------------------------------+

Notice, the first COLLATE was ignored, the last COLLATE was used.

The same problem is repeatable on the table level. See MDEV-28117.


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