Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
SHOW CREATE TABLE produces a CREATE TABLE statement where any CHARACTER SET clauses are incorrectly placed, making the SQL invalid. SHOW CREATE TABLE is used by mysqldump.
mysql> create table t1 (f1 char(32), v2 char(32) character set ucs2 AS (f1) VIRTUAL);
mysql> show create table t1\G
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1. row ***************************
Table: t1
Create Table: CREATE TABLE `t1` (
`f1` char(32) DEFAULT NULL,
`v2` char(32) AS (f1) VIRTUAL CHARACTER SET ucs2
) ENGINE=InnoDB DEFAULT CHARSET=latin1
1 row in set (0.00 sec)
- 1. row ***************************
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
This SQL is not valid – CHARACTER SET was placed after VIRTUAL, even though it must be between char(32) and AS.
All of the following must come before the AS () virtual column definition:
- field type and dimensions;
- unsigned
- zerofill
- character set
- collation