diff options
Diffstat (limited to 'mysql-test/main/win_percentile.result')
-rw-r--r-- | mysql-test/main/win_percentile.result | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/mysql-test/main/win_percentile.result b/mysql-test/main/win_percentile.result index a2ca775fcfb..09c2c4fc5de 100644 --- a/mysql-test/main/win_percentile.result +++ b/mysql-test/main/win_percentile.result @@ -99,7 +99,14 @@ Tatiana select score, percentile_cont(0.5) within group(order by name) over (partition by score) from t1; ERROR HY000: Numeric datatype is required for percentile_cont function select score, percentile_disc(0.5) within group(order by name) over (partition by score) from t1; -ERROR HY000: Numeric datatype is required for percentile_disc function +score percentile_disc(0.5) within group(order by name) over (partition by score) +3.0000 Chun +3.0000 Chun +4.0000 Tata +4.0000 Tata +4.0000 Tata +7.0000 Chun +7.0000 Chun #parameter value should be in the range of [0,1] select percentile_disc(1.5) within group(order by score) over (partition by name) from t1; ERROR HY000: Argument to the percentile_disc function does not belong to the range [0,1] @@ -452,7 +459,7 @@ Lord of the Ladybirds 30000000000.00 Lord of the Ladybirds 30000000000.00 DROP TABLE t2, t1; # -# MDEV-20272 PERCENTILE_DISC() crashes on a temporal type input +# MDEV-20280 PERCENTILE_DISC() rejects temporal and string input # CREATE OR REPLACE TABLE t1 (name CHAR(30), star_rating TIME); INSERT INTO t1 VALUES ('Lord of the Ladybirds', 5); @@ -463,5 +470,28 @@ INSERT INTO t1 VALUES ('Lady of the Flies', 5); SELECT name, PERCENTILE_DISC(0.5) WITHIN GROUP (ORDER BY star_rating) OVER (PARTITION BY name) AS pc FROM t1; -ERROR HY000: Numeric datatype is required for percentile_disc function +name pc +Lady of the Flies 00:00:02 +Lady of the Flies 00:00:02 +Lady of the Flies 00:00:02 +Lord of the Ladybirds 00:00:03 +Lord of the Ladybirds 00:00:03 +SELECT name, PERCENTILE_DISC(0) +WITHIN GROUP (ORDER BY star_rating) +OVER (PARTITION BY name) AS pc FROM t1; +name pc +Lady of the Flies 00:00:01 +Lady of the Flies 00:00:01 +Lady of the Flies 00:00:01 +Lord of the Ladybirds 00:00:03 +Lord of the Ladybirds 00:00:03 +SELECT name, PERCENTILE_DISC(1) +WITHIN GROUP (ORDER BY star_rating) +OVER (PARTITION BY name) AS pc FROM t1; +name pc +Lady of the Flies 00:00:05 +Lady of the Flies 00:00:05 +Lady of the Flies 00:00:05 +Lord of the Ladybirds 00:00:05 +Lord of the Ladybirds 00:00:05 DROP TABLE t1; |