Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18780,7 +18780,7 @@ impl<'a> Parser<'a> {
return self.expected(" another option or EOF", self.peek_token());
}
}
Token::EOF => break,
Token::EOF | Token::SemiColon => break,
Token::Comma => {
delimiter = KeyValueOptionsDelimiter::Comma;
continue;
Expand All @@ -18792,7 +18792,12 @@ impl<'a> Parser<'a> {
self.prev_token();
break;
}
_ => return self.expected("another option, EOF, Comma or ')'", self.peek_token()),
_ => {
return self.expected(
"another option, EOF, SemiColon, Comma or ')'",
self.peek_token(),
)
}
};
}

Expand Down
8 changes: 8 additions & 0 deletions tests/sqlparser_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18052,3 +18052,11 @@ fn parse_overlap_as_bool_and() {
let dialects = all_dialects_where(|d| d.supports_double_ampersand_operator());
dialects.one_statement_parses_to("SELECT x && y", "SELECT x AND y");
}

#[test]
fn test_parse_key_value_options_trailing_semicolon() {
one_statement_parses_to(
"CREATE USER u1 option1='value1' option2='value2';",
"CREATE USER u1 option1='value1' option2='value2'",
);
}