[MDEV-17654] Incorrect syntax returned for column with CHECK constraint in the "SHOW CREATE TABLE ..." result Created: 2018-11-09 Updated: 2023-05-05 Resolved: 2019-05-02 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Admin statements, Parser |
| Affects Version/s: | 10.2.17, 10.3.9 |
| Fix Version/s: | 10.2.24, 10.3.15, 10.4.5 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Sibin | Assignee: | Anel Husakovic |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Consider the below example, 1)Create the below table,
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/ |
| Comments |
| Comment by Elena Stepanova [ 2018-11-09 ] |
|
Thanks for the report. Reproducible easily as described. While I thought we had another one about it, I cannot find it in JIRA, so let's use this one as primary. If somebody ever stumbles upon a similar existing report, please link them. |
| Comment by Elena Stepanova [ 2019-02-04 ] |
|
I"m raising the priority because there is another external report, |
| Comment by Jonathan M. Wilbur [ 2019-02-20 ] |
|
I don't know if you guys are aware, but there is a pull request out that fixes this already. It's just waiting to be merged. https://github.com/MariaDB/server/pull/924 |
| Comment by Sergei Golubchik [ 2019-04-05 ] |
|
jonathanwilbur1993, yes, jira links to it automatically (see the right side of the page). It will be in the next 10.2 release. |
| Comment by Sergei Golubchik [ 2019-04-07 ] |
|
overdue PR |
| Comment by Sergey Vojtovich [ 2019-04-30 ] |
|
serg, could you review https://github.com/MariaDB/server/pull/924? I wonder if our parser has good reasons to require this order. Also are there other attributes that need to be properly ordered wrt CHECK. |
| Comment by Sergei Golubchik [ 2019-04-30 ] |
|
That's what the standard says. The order is column type [default] [constraint] [collate]. We still have collate on the wrong place, but it'd break lots of applications if we move it. |