colinhacks opened a new pull request, #2994:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2994

   Dialects: MsSql, Generic
   
   With `require_semicolon_stmt_delimiter = false`, statements at the top level 
of a batch need no `;`, but statements inside a `BEGIN ... END` block, a 
`WHILE` body, or a procedure, function or trigger body still did. `BEGIN SELECT 
1 SELECT 2 END` failed with `Expected: ;, found: SELECT`, and `WHILE @i < 3 
BEGIN SET @i = @i + 1; SELECT @i END` with `Expected: ;, found: END`. T-SQL 
makes the semicolon optional in both places 
(https://learn.microsoft.com/en-us/sql/t-sql/language-elements/transact-sql-syntax-conventions-transact-sql).
   
   `parse_statement_list` now skips any `;` before and after each statement 
when the option is off, as `parse_statements` does at the top level. With the 
default options a `;` is still required after each statement. The same change 
was part of #1949.
   
   Not covered: with the option off, a keyword that ends a block can still be 
read as an implicit alias in dialects that accept it as one, as statement 
keywords can be at the top level today, e.g. `ELSE` in Generic's `IF x THEN 
SELECT a FROM t ELSE ...`. For MsSql, statement keywords read as implicit 
aliases are #2991, and a `WHILE` without `BEGIN` taking the statements after it 
is #2992.
   
   Refs #1800
   
   Written with an AI coding assistant.
   


-- 
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]

Reply via email to