Fix bug when parsing a Snowflake stage with ; suffix (#1688)

This commit is contained in:
Yoav Cohen 2025-01-29 17:50:36 +01:00 committed by GitHub
parent 7980c866a3
commit 784605c913
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -625,7 +625,7 @@ pub fn parse_stage_name_identifier(parser: &mut Parser) -> Result<Ident, ParserE
let mut ident = String::new();
while let Some(next_token) = parser.next_token_no_skip() {
match &next_token.token {
Token::Whitespace(_) => break,
Token::Whitespace(_) | Token::SemiColon => break,
Token::Period => {
parser.prev_token();
break;

View file

@ -3102,6 +3102,10 @@ fn parse_ls_and_rm() {
};
snowflake().verified_stmt(r#"LIST @"STAGE_WITH_QUOTES""#);
// Semi-colon after stage name - should terminate the stage name
snowflake()
.parse_sql_statements("LIST @db1.schema1.stage1/dir1/;")
.unwrap();
}
#[test]