File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -2510,6 +2510,17 @@ fn parse_floor_number_scale() {
2510
2510
fn parse_ceil_scale ( ) {
2511
2511
let sql = "SELECT CEIL(d, 2)" ;
2512
2512
let select = verified_only_select ( sql) ;
2513
+
2514
+ #[ cfg( feature = "bigdecimal" ) ]
2515
+ assert_eq ! (
2516
+ & Expr :: Ceil {
2517
+ expr: Box :: new( Expr :: Identifier ( Ident :: new( "d" ) ) ) ,
2518
+ field: CeilFloorKind :: Scale ( Value :: Number ( bigdecimal:: BigDecimal :: from( 2 ) , false ) ) ,
2519
+ } ,
2520
+ expr_from_projection( only( & select. projection) ) ,
2521
+ ) ;
2522
+
2523
+ #[ cfg( not( feature = "bigdecimal" ) ) ]
2513
2524
assert_eq ! (
2514
2525
& Expr :: Ceil {
2515
2526
expr: Box :: new( Expr :: Identifier ( Ident :: new( "d" ) ) ) ,
@@ -2523,6 +2534,17 @@ fn parse_ceil_scale() {
2523
2534
fn parse_floor_scale ( ) {
2524
2535
let sql = "SELECT FLOOR(d, 2)" ;
2525
2536
let select = verified_only_select ( sql) ;
2537
+
2538
+ #[ cfg( feature = "bigdecimal" ) ]
2539
+ assert_eq ! (
2540
+ & Expr :: Floor {
2541
+ expr: Box :: new( Expr :: Identifier ( Ident :: new( "d" ) ) ) ,
2542
+ field: CeilFloorKind :: Scale ( Value :: Number ( bigdecimal:: BigDecimal :: from( 2 ) , false ) ) ,
2543
+ } ,
2544
+ expr_from_projection( only( & select. projection) ) ,
2545
+ ) ;
2546
+
2547
+ #[ cfg( not( feature = "bigdecimal" ) ) ]
2526
2548
assert_eq ! (
2527
2549
& Expr :: Floor {
2528
2550
expr: Box :: new( Expr :: Identifier ( Ident :: new( "d" ) ) ) ,
You can’t perform that action at this time.
0 commit comments