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

fixed sql splitting issue #1563

Closed
wants to merge 9 commits into from
Closed

fixed sql splitting issue #1563

wants to merge 9 commits into from

Conversation

DuanYuePeng
Copy link

@DuanYuePeng DuanYuePeng commented Jun 23, 2019

Issue 1

for below sql statement, the split function will fail because the table name contains "END".

CREATE TABLE bar (foo VARCHAR(255));
CREATE TABLE gender (gender VARCHAR(255));
CREATE TABLE foo (bar VARCHAR(255));

fixed this issue by checking whether the keywords (END or BEGIN) is separated by any controlling char. eg. '\t', '\n' or ' '.

Issue 2

for below sql statement, the split function will fail because of incorrect inBlockComment flag.

CREATE TABLE bar (foo VARCHAR(255));
/* Insert Values */
INSERT INTO bar (foo) values ('--1');
INSERT INTO bar (foo) values ('--2');

fixed this issue by setting inBlockComment to false after skipping the block comment.

@DuanYuePeng DuanYuePeng changed the title fixed keywords parsing issue fixed sql splitting issue Jun 23, 2019
@rnorth rnorth self-assigned this Jun 28, 2019
@rnorth
Copy link
Member

rnorth commented Jun 28, 2019

Thank you @DuanYuePeng - I'll have a look soon.

@rnorth rnorth added this to the next milestone Jul 7, 2019
@rnorth
Copy link
Member

rnorth commented Jul 19, 2019

I've carried this over to #1627, where I've modified the tests to be more thorough.
@DuanYuePeng thanks for your work on this - it's impressively solid so far!

@rnorth rnorth closed this Jul 19, 2019
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

Successfully merging this pull request may close these issues.

None yet

2 participants