simple-ddl-parser icon indicating copy to clipboard operation
simple-ddl-parser copied to clipboard

Unable to parse mysql ddl with table configuration

Open vegetablest opened this issue 2 years ago • 0 comments

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

vegetablest avatar Sep 12 '23 06:09 vegetablest