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

fix(sql-parser): failed to report syntax error if the input's any prefix is grammatical #699

Merged
merged 2 commits into from
Nov 2, 2023

Conversation

yhilmare
Copy link
Contributor

@yhilmare yhilmare commented Nov 1, 2023

What type of PR is this?

type-bug

What this PR does / why we need it:

the parser will not report any syntax error if the input's any prefix is grammatical.

eg.

select * from test asdasdasd asdasdas asdasdasd asd;

the sql above has syntax error obviously but the parser will consider that this is a sql without any syntax error cause that the prefix of this sql select * from test is grammatical.

the root cause of this issue is that the parser does not parse a sql from the beginning to the end. The parser will return when it get a grammatical statement.

you can get more infos from the issue #693

Which issue(s) this PR fixes:

Fixes #693

Special notes for your reviewer:

Additional documentation e.g., usage docs, etc.:


@yhilmare yhilmare added type-bug Something isn't working module-sql parser ob sql parser module labels Nov 1, 2023
@yhilmare yhilmare added this to the ODC 4.2.2 milestone Nov 1, 2023
@yhilmare yhilmare self-assigned this Nov 1, 2023
Copy link
Contributor

@smallsheeeep smallsheeeep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yhilmare yhilmare merged commit 935d164 into dev/4.2.2 Nov 2, 2023
19 checks passed
@yhilmare yhilmare deleted the fix/shanlu_upgrade_version branch November 2, 2023 01:41
yhilmare added a commit that referenced this pull request Jan 15, 2024
…fix is grammatical (#699)

* builds: upgrade db-browser's version

* upgrade the parser's version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module-sql parser ob sql parser module type-bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants