Skip to content

Unable to parse mysql ddl with table configuration #206

Closed
@vegetablest

Description

@vegetablest

Describe the bug
If the MySQL table creation statement specifies table configuration such as storage engine or character encoding, the content will not be parsed.

To Reproduce
1.Parsed failed

CREATE TABLE `employee` (
  `user_id` int(11) NOT NULL AUTO_INCREMENT,
  `user_name` varchar(50) NOT NULL,
  `authority` int(11) DEFAULT '1' COMMENT 'user auth',
  PRIMARY KEY (`user_id`),
  KEY `FK_authority` (`user_id`,`user_name`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;

2.Parsed successfully

CREATE TABLE `employee` (
  `user_id` int(11) NOT NULL AUTO_INCREMENT,
  `user_name` varchar(50) NOT NULL,
  `authority` int(11) DEFAULT '1' COMMENT 'user auth',
  PRIMARY KEY (`user_id`),
  KEY `FK_authority` (`user_id`,`user_name`)
);

image

Expected behavior
I think both parsing should be able to parse the field information.

Additional context
python==3.11 simple-ddl-parser==0.31.0

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions