Fix parse_identifiers not taking semicolons into account #2137
+9
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to: #1994
The PR fixes the issue with semicolons disappearing when
SHOWstatements are parsed. The test prior to the fix would fail as follows:The fix adds a
SemicolonalongsideEOFandEqwhich were the only two tokens that triggered a break inparse_identifiers. This should not cause any unintended side effects as semicolons are exclusively used for statement ends.Additional considerations:
parse_showtest requiresSHOW ALL ALLto be parsed. This is not valid PostgreSQL syntax according to postgres 18 docs and was not valid since version 7.1 at least.parse_identifiersis seemingly supposed to be very relaxed (as indicated by the above test not failing) and also is used only twice in the code base. The first instance isSHOW, the other is theDROPthat comes after a pipe operator for which the current tests do not need the extra flexibility provided byparse_identifiers.I am willing to make a separate PR for modifying the
parse_showtest to use valid PostgreSQL syntax, I am not familiar enough with the code base to do anything with the latter.