@@ -5600,6 +5600,7 @@ fn parse_implicit_join() {
56005600 partitions: vec![ ] ,
56015601 with_ordinality: false ,
56025602 } ,
5603+ global: false ,
56035604 join_operator: JoinOperator :: Inner ( JoinConstraint :: Natural ) ,
56045605 } ] ,
56055606 } ,
@@ -5623,6 +5624,7 @@ fn parse_implicit_join() {
56235624 partitions: vec![ ] ,
56245625 with_ordinality: false ,
56255626 } ,
5627+ global: false ,
56265628 join_operator: JoinOperator :: Inner ( JoinConstraint :: Natural ) ,
56275629 } ] ,
56285630 } ,
@@ -5646,6 +5648,7 @@ fn parse_cross_join() {
56465648 partitions: vec![ ] ,
56475649 with_ordinality: false ,
56485650 } ,
5651+ global: false ,
56495652 join_operator: JoinOperator :: CrossJoin ,
56505653 } ,
56515654 only( only( select. from) . joins) ,
@@ -5657,6 +5660,7 @@ fn parse_joins_on() {
56575660 fn join_with_constraint (
56585661 relation : impl Into < String > ,
56595662 alias : Option < TableAlias > ,
5663+ global : bool ,
56605664 f : impl Fn ( JoinConstraint ) -> JoinOperator ,
56615665 ) -> Join {
56625666 Join {
@@ -5669,6 +5673,7 @@ fn parse_joins_on() {
56695673 partitions : vec ! [ ] ,
56705674 with_ordinality : false ,
56715675 } ,
5676+ global,
56725677 join_operator : f ( JoinConstraint :: On ( Expr :: BinaryOp {
56735678 left : Box :: new ( Expr :: Identifier ( "c1" . into ( ) ) ) ,
56745679 op : BinaryOperator :: Eq ,
@@ -5682,6 +5687,7 @@ fn parse_joins_on() {
56825687 vec![ join_with_constraint(
56835688 "t2" ,
56845689 table_alias( "foo" ) ,
5690+ false ,
56855691 JoinOperator :: Inner ,
56865692 ) ]
56875693 ) ;
@@ -5692,35 +5698,80 @@ fn parse_joins_on() {
56925698 // Test parsing of different join operators
56935699 assert_eq ! (
56945700 only( & verified_only_select( "SELECT * FROM t1 JOIN t2 ON c1 = c2" ) . from) . joins,
5695- vec![ join_with_constraint( "t2" , None , JoinOperator :: Inner ) ]
5701+ vec![ join_with_constraint( "t2" , None , false , JoinOperator :: Inner ) ]
56965702 ) ;
56975703 assert_eq ! (
56985704 only( & verified_only_select( "SELECT * FROM t1 LEFT JOIN t2 ON c1 = c2" ) . from) . joins,
5699- vec![ join_with_constraint( "t2" , None , JoinOperator :: LeftOuter ) ]
5705+ vec![ join_with_constraint(
5706+ "t2" ,
5707+ None ,
5708+ false ,
5709+ JoinOperator :: LeftOuter
5710+ ) ]
57005711 ) ;
57015712 assert_eq ! (
57025713 only( & verified_only_select( "SELECT * FROM t1 RIGHT JOIN t2 ON c1 = c2" ) . from) . joins,
5703- vec![ join_with_constraint( "t2" , None , JoinOperator :: RightOuter ) ]
5714+ vec![ join_with_constraint(
5715+ "t2" ,
5716+ None ,
5717+ false ,
5718+ JoinOperator :: RightOuter
5719+ ) ]
57045720 ) ;
57055721 assert_eq ! (
57065722 only( & verified_only_select( "SELECT * FROM t1 LEFT SEMI JOIN t2 ON c1 = c2" ) . from) . joins,
5707- vec![ join_with_constraint( "t2" , None , JoinOperator :: LeftSemi ) ]
5723+ vec![ join_with_constraint(
5724+ "t2" ,
5725+ None ,
5726+ false ,
5727+ JoinOperator :: LeftSemi
5728+ ) ]
57085729 ) ;
57095730 assert_eq ! (
57105731 only( & verified_only_select( "SELECT * FROM t1 RIGHT SEMI JOIN t2 ON c1 = c2" ) . from) . joins,
5711- vec![ join_with_constraint( "t2" , None , JoinOperator :: RightSemi ) ]
5732+ vec![ join_with_constraint(
5733+ "t2" ,
5734+ None ,
5735+ false ,
5736+ JoinOperator :: RightSemi
5737+ ) ]
57125738 ) ;
57135739 assert_eq ! (
57145740 only( & verified_only_select( "SELECT * FROM t1 LEFT ANTI JOIN t2 ON c1 = c2" ) . from) . joins,
5715- vec![ join_with_constraint( "t2" , None , JoinOperator :: LeftAnti ) ]
5741+ vec![ join_with_constraint(
5742+ "t2" ,
5743+ None ,
5744+ false ,
5745+ JoinOperator :: LeftAnti
5746+ ) ]
57165747 ) ;
57175748 assert_eq ! (
57185749 only( & verified_only_select( "SELECT * FROM t1 RIGHT ANTI JOIN t2 ON c1 = c2" ) . from) . joins,
5719- vec![ join_with_constraint( "t2" , None , JoinOperator :: RightAnti ) ]
5750+ vec![ join_with_constraint(
5751+ "t2" ,
5752+ None ,
5753+ false ,
5754+ JoinOperator :: RightAnti
5755+ ) ]
57205756 ) ;
57215757 assert_eq ! (
57225758 only( & verified_only_select( "SELECT * FROM t1 FULL JOIN t2 ON c1 = c2" ) . from) . joins,
5723- vec![ join_with_constraint( "t2" , None , JoinOperator :: FullOuter ) ]
5759+ vec![ join_with_constraint(
5760+ "t2" ,
5761+ None ,
5762+ false ,
5763+ JoinOperator :: FullOuter
5764+ ) ]
5765+ ) ;
5766+
5767+ assert_eq ! (
5768+ only( & verified_only_select( "SELECT * FROM t1 GLOBAL FULL JOIN t2 ON c1 = c2" ) . from) . joins,
5769+ vec![ join_with_constraint(
5770+ "t2" ,
5771+ None ,
5772+ true ,
5773+ JoinOperator :: FullOuter
5774+ ) ]
57245775 ) ;
57255776}
57265777
@@ -5741,6 +5792,7 @@ fn parse_joins_using() {
57415792 partitions : vec ! [ ] ,
57425793 with_ordinality : false ,
57435794 } ,
5795+ global : false ,
57445796 join_operator : f ( JoinConstraint :: Using ( vec ! [ "c1" . into( ) ] ) ) ,
57455797 }
57465798 }
@@ -5805,6 +5857,7 @@ fn parse_natural_join() {
58055857 partitions : vec ! [ ] ,
58065858 with_ordinality : false ,
58075859 } ,
5860+ global : false ,
58085861 join_operator : f ( JoinConstraint :: Natural ) ,
58095862 }
58105863 }
@@ -6073,6 +6126,7 @@ fn parse_derived_tables() {
60736126 partitions: vec![ ] ,
60746127 with_ordinality: false ,
60756128 } ,
6129+ global: false ,
60766130 join_operator: JoinOperator :: Inner ( JoinConstraint :: Natural ) ,
60776131 } ] ,
60786132 } ) ,
@@ -6983,6 +7037,7 @@ fn lateral_function() {
69837037 ] ,
69847038 alias: None ,
69857039 } ,
7040+ global: false ,
69867041 join_operator: JoinOperator :: LeftOuter ( JoinConstraint :: None ) ,
69877042 } ] ,
69887043 } ] ,
0 commit comments