jnlt3 opened a new pull request, #2137: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2137
Related to: https://github.com/apache/datafusion-sqlparser-rs/issues/1994 The PR fixes the issue with semicolons disappearing when `SHOW` statements are parsed. The test prior to the fix would fail as follows: ``` assertion `left == right` failed left: "SHOW search_path; SELECT 1" right: "SHOW search_path SELECT" ``` The fix adds a `Semicolon` alongside `EOF` and `Eq` which were the only two tokens that triggered a break in `parse_identifiers`. This should not cause any unintended side effects as semicolons are exclusively used for statement ends. Additional considerations: - The `parse_show` test requires `SHOW ALL ALL` to be parsed. This is not valid PostgreSQL syntax according to [postgres 18 docs](https://www.postgresql.org/docs/18/sql-show.html) and was not valid since version 7.1 at least. - `parse_identifiers` is 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 is `SHOW`, the other is the `DROP` that comes after a pipe operator for which the current tests do not need the extra flexibility provided by `parse_identifiers`. I am willing to make a separate PR for modifying the `parse_show` test to use valid PostgreSQL syntax, I am not familiar enough with the code base to do anything with the latter. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
