[Impro](regression-test) More test cases for function round (#24791)
This commit is contained in:
@ -11,6 +11,30 @@
|
||||
-- !select --
|
||||
10.12
|
||||
|
||||
-- !select --
|
||||
0.0 0.0
|
||||
0.5 0.0
|
||||
1.0 1.0
|
||||
1.5 2.0
|
||||
2.0 2.0
|
||||
2.5 2.0
|
||||
3.0 3.0
|
||||
3.5 4.0
|
||||
4.0 4.0
|
||||
4.5 4.0
|
||||
|
||||
-- !select --
|
||||
0.0 0.0
|
||||
0.5 1.0
|
||||
1.0 1.0
|
||||
1.5 2.0
|
||||
2.0 2.0
|
||||
2.5 3.0
|
||||
3.0 3.0
|
||||
3.5 4.0
|
||||
4.0 4.0
|
||||
4.5 5.0
|
||||
|
||||
-- !truncate --
|
||||
1 1989 1001 123.1 0.1 6.3
|
||||
2 1986 1001 1243.5 20.2 789.2
|
||||
|
||||
@ -21,6 +21,11 @@
|
||||
qt_select "SELECT round_bankers(10.12345)"
|
||||
qt_select "SELECT round_bankers(10.12345, 2)"
|
||||
|
||||
// test tie case 1: float, banker's rounding
|
||||
qt_select "SELECT number*10/100 AS x, ROUND(number * 10 / 100) from NUMBERS('number'=50) where number % 5 = 0 ORDER BY x;"
|
||||
// test tie case 2: decimal, rounded up when tie
|
||||
qt_select "SELECT number*10/100 AS x, ROUND(CAST(number * 10 AS DECIMALV3(10,2)) / 100) from NUMBERS('number'=50) where number % 5 = 0 ORDER BY x;"
|
||||
|
||||
def tableTest = "test_query_db.test"
|
||||
qt_truncate "select truncate(k1, 1), truncate(k2, 1), truncate(k3, 1), truncate(k5, 1), truncate(k8, 1), truncate(k9, 1) from ${tableTest} order by 1;"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user