iffyio commented on code in PR #1497:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/1497#discussion_r1830403524
##########
src/parser/mod.rs:
##########
@@ -5335,7 +5335,7 @@ impl<'a> Parser<'a> {
for_query: None,
});
- if self.next_token() != Token::Comma {
+ if self.peek_token().token == Token::SemiColon ||
self.next_token() != Token::Comma {
Review Comment:
Oh could this be simplified if we reused the `self.parse_comma_separated()`
variant? I think if thats' possible it would be more conventional to use in the
codebase (and would've prevented the edge case)
##########
tests/sqlparser_mssql.rs:
##########
@@ -626,6 +626,72 @@ fn parse_mssql_declare() {
}],
ast
);
+
+ let sql = "DECLARE @bar INT;SET @bar = 2;SELECT @bar * 4";
+ let ast = Parser::parse_sql(&MsSqlDialect {}, sql).unwrap();
Review Comment:
Can this use `ms().parse_sql_statements(sql)`?
--
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]