File tree 2 files changed +9
-9
lines changed
2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -433,15 +433,14 @@ impl fmt::Display for WindowSpec {
433
433
write ! ( f, "ORDER BY {}" , display_comma_separated( & self . order_by) ) ?;
434
434
}
435
435
if let Some ( window_frame) = & self . window_frame {
436
+ f. write_str ( delim) ?;
436
437
if let Some ( end_bound) = & window_frame. end_bound {
437
- f. write_str ( delim) ?;
438
438
write ! (
439
439
f,
440
440
"{} BETWEEN {} AND {}" ,
441
441
window_frame. units, window_frame. start_bound, end_bound
442
442
) ?;
443
443
} else {
444
- f. write_str ( delim) ?;
445
444
write ! ( f, "{} {}" , window_frame. units, window_frame. start_bound) ?;
446
445
}
447
446
}
Original file line number Diff line number Diff line change @@ -1620,9 +1620,10 @@ impl<'a> Parser<'a> {
1620
1620
loop {
1621
1621
if let Some ( constraint) = self . parse_optional_table_constraint ( ) ? {
1622
1622
constraints. push ( constraint) ;
1623
- } else if let Token :: Word ( _) = self . peek_token ( ) {
1624
- columns. push ( self . parse_column_def ( ) ?) ;
1625
- } else if let Token :: BackQuotedString ( _) = self . peek_token ( ) {
1623
+ } else if matches ! (
1624
+ self . peek_token( ) ,
1625
+ Token :: Word ( _) | Token :: BackQuotedString ( _)
1626
+ ) {
1626
1627
columns. push ( self . parse_column_def ( ) ?) ;
1627
1628
} else {
1628
1629
return self . expected ( "column name or constraint definition" , self . peek_token ( ) ) ;
@@ -2793,10 +2794,10 @@ impl<'a> Parser<'a> {
2793
2794
// followed by some joins or (B) another level of nesting.
2794
2795
let mut table_and_joins = self . parse_table_and_joins ( ) ?;
2795
2796
2796
- if !table_and_joins. joins . is_empty ( ) {
2797
- self . expect_token ( & Token :: RParen ) ? ;
2798
- Ok ( TableFactor :: NestedJoin ( Box :: new ( table_and_joins ) ) ) // (A)
2799
- } else if let TableFactor :: NestedJoin ( _ ) = & table_and_joins . relation {
2797
+ if !table_and_joins. joins . is_empty ( )
2798
+ || matches ! ( & table_and_joins . relation , TableFactor :: NestedJoin ( _ ) )
2799
+ {
2800
+ // (A)
2800
2801
// (B): `table_and_joins` (what we found inside the parentheses)
2801
2802
// is a nested join `(foo JOIN bar)`, not followed by other joins.
2802
2803
self . expect_token ( & Token :: RParen ) ?;
You can’t perform that action at this time.
0 commit comments