Details
-
Bug
-
Status: Closed (View Workflow)
-
Blocker
-
Resolution: Fixed
-
10.2.17, 10.3.9
-
None
Description
Consider the below example,
1)Create the below table,
CREATE TABLE `t1` (`name` VARCHAR(30) CHECK (CHAR_LENGTH(`name`)>2), `start_date` DATE, `end_date` DATE COMMENT 'DATE COLUMN' CHECK (`start_date` is NULL OR `end_date` is NULL OR `start_date`<`end_date`)); |
2) Execute "SHOW CREATE TABLE `t1`"
3) Copy the result returned by the query executed in Step-2.
4) Execute the copied query in Step-3 after renaming the table name
5) The query execution will fail due to incorrect syntax. The issue is "COMMENT" column_definition comes after the 'CHECK' constraint_definition. Refer the MariaDB create table syntax >> https://mariadb.com/kb/en/library/create-table/
Attachments
Issue Links
- duplicates
-
MDEV-19163 When you have a COMMENT and a CHECK on a column, the SHOW CREATE TABLE creates an invalid query
- Closed
- is duplicated by
-
MDEV-18473 DB restore fails when CHECK and COMMENT are used
- Closed
-
MDEV-31191 mysqldump bad format when using CHECK and COMMENT
- Closed