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

[postgresql] Fix for #4300 -- ambiguity in from_list #4301

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

kaby76
Copy link
Contributor

@kaby76 kaby76 commented Nov 1, 2024

This PR fixes a grammar ambiguity introduced with #3008.

Consider input select x from t c1, t c2;. The substring t c1, t c2 can be parsed two ways:

  • from_list => non_ansi_join => table_ref ... ==> t c1, t c2
  • from_list => table_ref ... ==> t c1, t c2

As I point out in the write-up for #4300, from_list is defined with two alts that overlap. The two alts did not fix anything. It simply added to the ambiguity of the grammar and made the parser perform worse.

I discovered this using trparse --ambig.

@kaby76 kaby76 changed the title [postgresql] Fix #4300 [postgresql] Fix for #4300 Nov 1, 2024
@kaby76 kaby76 changed the title [postgresql] Fix for #4300 [postgresql] Fix for #4300 -- ambiguity in from_list Nov 4, 2024
@teverett
Copy link
Member

teverett commented Nov 4, 2024

@kaby76 thanks!

@teverett teverett merged commit 7a8c173 into antlr:master Nov 4, 2024
10 checks passed
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.

2 participants