Skip to content

Commit c1efb4f

Browse files
committed
Rewind the current token before parse_go
1 parent 04a94d9 commit c1efb4f

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/parser/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,10 @@ impl<'a> Parser<'a> {
729729
self.parse_vacuum()
730730
}
731731
Keyword::RESET => self.parse_reset().map(Into::into),
732-
Keyword::GO => self.parse_go(),
732+
Keyword::GO => {
733+
self.prev_token();
734+
self.parse_go()
735+
}
733736
_ => self.expected("an SQL statement", next_token),
734737
},
735738
Token::LParen => {
@@ -19688,6 +19691,8 @@ impl<'a> Parser<'a> {
1968819691

1968919692
/// Parse [Statement::Go]
1969019693
fn parse_go(&mut self) -> Result<Statement, ParserError> {
19694+
self.expect_keyword_is(Keyword::GO)?;
19695+
1969119696
// disambiguate between GO as batch delimiter & GO as identifier (etc)
1969219697
// compare:
1969319698
// ```sql

0 commit comments

Comments
 (0)