File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -4780,9 +4780,9 @@ fn parse_aggregate_with_group_by() {
4780
4780
4781
4781
#[ test]
4782
4782
fn parse_literal_integer ( ) {
4783
- let sql = "SELECT 1, -10" ;
4783
+ let sql = "SELECT 1, -10, +20 " ;
4784
4784
let select = verified_only_select ( sql) ;
4785
- assert_eq ! ( 2 , select. projection. len( ) ) ;
4785
+ assert_eq ! ( 3 , select. projection. len( ) ) ;
4786
4786
assert_eq ! (
4787
4787
& Expr :: Value ( number( "1" ) ) ,
4788
4788
expr_from_projection( & select. projection[ 0 ] ) ,
@@ -4794,6 +4794,14 @@ fn parse_literal_integer() {
4794
4794
expr: Box :: new( Expr :: Value ( number( "10" ) ) )
4795
4795
} ,
4796
4796
expr_from_projection( & select. projection[ 1 ] ) ,
4797
+ ) ;
4798
+ // positive literal is parsed as a + and expr
4799
+ assert_eq ! (
4800
+ & UnaryOp {
4801
+ op: UnaryOperator :: Plus ,
4802
+ expr: Box :: new( Expr :: Value ( number( "20" ) ) )
4803
+ } ,
4804
+ expr_from_projection( & select. projection[ 2 ] ) ,
4797
4805
)
4798
4806
}
4799
4807
You can’t perform that action at this time.
0 commit comments