Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to parse mysql ddl with table configuration #206

Closed
vegetablest opened this issue Sep 12, 2023 · 3 comments
Closed

Unable to parse mysql ddl with table configuration #206

vegetablest opened this issue Sep 12, 2023 · 3 comments
Assignees

Comments

@vegetablest
Copy link

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

@utkarshkoppikar7
Copy link

I have noticed the same behaviour, should we have procedure to filter these properties out?

@xnuinside xnuinside self-assigned this May 9, 2024
@xnuinside
Copy link
Owner

xnuinside commented May 9, 2024

Fix was released in version 1.2.1 - https://pypi.org/project/simple-ddl-parser/ #247. @vegetablest thanks for reporting this issue, @utkarshkoppikar7 thanks for comment, it was good push to work on it ) . test was added: https://github.com/xnuinside/simple-ddl-parser/blob/main/tests/dialects/test_mysql.py#L550. thanks one more time! if will be any other issues - feel free to open new one

@vegetablest
Copy link
Author

awesome👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants