File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -8747,7 +8747,9 @@ impl<'a> Parser<'a> {
8747
8747
}
8748
8748
Token::Number(s, false) if s.chars().all(|c| c.is_ascii_digit()) => {
8749
8749
ident.value.push_str(&s);
8750
- true
8750
+ // If next token is period, then it is part of an ObjectName and we don't expect whitespace
8751
+ // after the number.
8752
+ !matches!(self.peek_token().token, Token::Period)
8751
8753
}
8752
8754
_ => {
8753
8755
return self
Original file line number Diff line number Diff line change @@ -1522,6 +1522,26 @@ fn parse_hyphenated_table_identifiers() {
1522
1522
"SELECT * FROM foo-bar AS f JOIN baz-qux AS b ON f.id = b.id" ,
1523
1523
) ;
1524
1524
1525
+ assert_eq ! (
1526
+ bigquery( )
1527
+ . verified_only_select_with_canonical(
1528
+ "select * from foo-123.bar" ,
1529
+ "SELECT * FROM foo-123.bar"
1530
+ )
1531
+ . from[ 0 ]
1532
+ . relation,
1533
+ TableFactor :: Table {
1534
+ name: ObjectName ( vec![ Ident :: new( "foo-123" ) , Ident :: new( "bar" ) ] ) ,
1535
+ alias: None ,
1536
+ args: None ,
1537
+ with_hints: vec![ ] ,
1538
+ version: None ,
1539
+ partitions: vec![ ] ,
1540
+ with_ordinality: false ,
1541
+ json_path: None ,
1542
+ }
1543
+ ) ;
1544
+
1525
1545
assert_eq ! (
1526
1546
bigquery( )
1527
1547
. verified_only_select_with_canonical(
You can’t perform that action at this time.
0 commit comments