aharpervc commented on code in PR #1809:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/1809#discussion_r2052462208
##########
src/parser/mod.rs:
##########
@@ -15064,6 +15117,38 @@ impl<'a> Parser<'a> {
}))
}
+ /// Parse [Statement::Go]
+ fn parse_go(&mut self) -> Result<Statement, ParserError> {
+ self.expect_previously_only_whitespace_until_newline()?;
Review Comment:
> hmm this call look equivalent to the loop below that peeks forward to skip
newlines? unclear why we're peeking backwards here right after we parsed the GO
keyword (so that this will always be infallible?)
The too loops aren't the same. The reason we need to peek look backwards
here is to forbid this syntax:
```sql
-- `GO` is disallowed
select 1; go
```
If you actually run this on a real SQL Server instance, you will also get a
similar error: `Incorrect syntax near 'go'.`. Therefore it seems prudent to
forbid this syntax from parsing here in this library.
--
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]