Skip to content

[BUG] MYSQL: incorrect syntax for SET and ENUM export SQL #251

Closed
@csc530

Description

@csc530

When creating a MYSQL database creating a table with an ENUM or SET column type the exported SQL file (under file > export SQL) is incorrect.
Whether valid, invalid, or empty values are entered in the drawdb column's values input.
Currently, the exported syntax is

CREATE TABLE .... (
  `enum_column` ENUM ...,
  `set_column` SET ...,
  ...
);

missing brackets containing the enum/set's values

the expected output is...

CREATE TABLE .... (
  `enum_column` ENUM('value','val',...) ...,
  `set_column` SET('a','1',...) ...,
  ...
);

To Reproduce

Steps to reproduce the behaviour:

  1. Go to drawdb editor
  2. Choose a MySQL database
  3. Create a new table
  4. Add a column of set or enum type
  5. Add values for the column
  6. Click on file > 'Export SQL'
  7. See erroneous create table statement

Desktop:

  • OS: Microsoft Windows 11 Home
  • Browser Microsoft Edge

Additional context

Not sure if the MySQL export is for a different version of MySQL (I'm using MySQL V8.0.30), I have a pr to solve the issue that I will link to this issue.

I'm happy to open a PR with a fix to this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions