Skip to content

Commit 6a26aa4

Browse files
committed
address comments
1 parent c603785 commit 6a26aa4

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src/parser/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8384,9 +8384,9 @@ impl<'a> Parser<'a> {
83848384
loop {
83858385
if self.dialect.supports_object_name_double_dot_notation()
83868386
&& idents.len() == 1
8387-
&& self.peek_token() == Token::Period
8387+
&& self.consume_token(&Token::Period)
83888388
{
8389-
self.next_token();
8389+
// Empty string here means default schema
83908390
idents.push(Ident::new(""));
83918391
}
83928392
idents.push(self.parse_identifier(in_table_clause)?);

tests/sqlparser_snowflake.rs

+10-7
Original file line numberDiff line numberDiff line change
@@ -2869,21 +2869,21 @@ fn test_projection_with_nested_trailing_commas() {
28692869
fn test_sf_double_dot_notation() {
28702870
snowflake().verified_stmt("SELECT * FROM db_name..table_name");
28712871
snowflake().verified_stmt("SELECT * FROM x, y..z JOIN a..b AS b ON x.id = b.id");
2872-
}
2873-
2874-
#[test]
2875-
fn test_sf_double_dot_notation_wrong_position() {}
28762872

2877-
#[test]
2878-
fn test_parse_double_dot_notation_wrong_position() {
28792873
assert_eq!(
28802874
snowflake()
28812875
.parse_sql_statements("SELECT * FROM X.Y..")
28822876
.unwrap_err()
28832877
.to_string(),
28842878
"sql parser error: Expected: identifier, found: ."
28852879
);
2886-
2880+
assert_eq!(
2881+
snowflake()
2882+
.parse_sql_statements("SELECT * FROM X..Y..Z")
2883+
.unwrap_err()
2884+
.to_string(),
2885+
"sql parser error: Expected: identifier, found: ."
2886+
);
28872887
assert_eq!(
28882888
// Ensure we don't parse leading token
28892889
snowflake()
@@ -2893,3 +2893,6 @@ fn test_parse_double_dot_notation_wrong_position() {
28932893
"sql parser error: Expected: identifier, found: ."
28942894
);
28952895
}
2896+
2897+
#[test]
2898+
fn test_parse_double_dot_notation_wrong_position() {}

0 commit comments

Comments
 (0)