Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
5.5(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL)
Description
CREATE TABLE t1 ( |
f1 ENUM ('a','b') CHARACTER SET ucs2, |
f2 ENUM ('a','b') CHARACTER SET ucs2 |
);
|
SHOW CREATE TABLE t1; |
The table is created seemingly without a problem, but the definition is wrong (note question marks):
10.3 803d0521 |
MariaDB [test]> CREATE TABLE t1 ( |
-> f1 ENUM ('a','b') CHARACTER SET ucs2, |
-> f2 ENUM ('a','b') CHARACTER SET ucs2 |
-> );
|
Query OK, 0 rows affected (0.311 sec) |
|
MariaDB [test]> SHOW CREATE TABLE t1; |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
| Table | Create Table | |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
| t1 | CREATE TABLE `t1` ( |
`f1` enum('?','?') CHARACTER SET ucs2 DEFAULT NULL, |
`f2` enum('?','?') CHARACTER SET ucs2 DEFAULT NULL |
) ENGINE=InnoDB DEFAULT CHARSET=latin1 | |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
1 row in set (0.002 sec) |
And indeed, an attempt to insert a value causes a problem:
MariaDB [test]> INSERT INTO t1 VALUES ('a','a'); |
ERROR 1265 (01000): Data truncated for column 'f1' at row 1 |
Same with SETs.
When there is only one such field, it works all right (note that f2 is now utf8):
MariaDB [test]> CREATE TABLE t1 ( |
-> f1 ENUM ('a','b') CHARACTER SET ucs2, |
-> f2 ENUM ('a','b') CHARACTER SET utf8 |
-> );
|
Query OK, 0 rows affected (0.215 sec) |
|
MariaDB [test]> SHOW CREATE TABLE t1; |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
| Table | Create Table | |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
| t1 | CREATE TABLE `t1` ( |
`f1` enum('a','b') CHARACTER SET ucs2 DEFAULT NULL, |
`f2` enum('a','b') CHARACTER SET utf8 DEFAULT NULL |
) ENGINE=InnoDB DEFAULT CHARSET=latin1 | |
+-------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
1 row in set (0.002 sec) |
Reproducible on all MariaDB 5.5-10.5 and MySQL 5.6/5.7. Not reproducible on MySQL 8.0.
Attachments
Issue Links
- relates to
-
MDEV-22111 ERROR 1064 & 1033 and SIGSEGV on CREATE TABLE w/ various charsets on 10.4/5 optimized builds | Assertion `(uint) (table_check_constraints - share->check_constraints) == (uint) (share->table_check_constraints - share->field_check_constraints)' failed
- Closed