Expand parse without semicolons #1949
Open
+837
−139
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.
This PR is a followup (ref) to recent work on parsing without requiring semicolon statement delimiters. It's the same content as my former PR which was stale after #1937.
This PR is rebased on latest master and brings forward the increased test coverage and additional parsing fixes from the previous branch.
Particularly, this PR expands support as follows:
supports_statements_without_semicolon_delimiter
dialect trait function (default false, but true for SQL Server). Now we can set the default parser option based on the dialectstatements_without_semicolons_parse_to
which deletes semicolons from the string, then parses it (simplifies testing parsing with & without),all_dialects_requiring_semicolon_statement_delimiter
&all_dialects_not_requiring_semicolon_statement_delimiter
to find configured dialects, andassert_err_parse_statements
to simplify asserting "end of statement" vs "an SQL statement" errors. A lot of test assertions that fail when requiring semicolons also fail when not requiring semicolons, but what precisely the parser will complain about could be different (again, if you write SQL this way, you accept that possibility). The helper functions enable running existing tests on dialects that don't require semicolons with minimal changes. The main usage there is in the "common" tests.