MDEV-15846: Sever crashed with MEDIAN() window function

Fixed by MDEV-15902, just added the test case for this issue.
This commit is contained in:
Varun Gupta 2018-04-21 18:38:58 +05:30
parent c058117c6c
commit 6b1a8b2c72
2 changed files with 20 additions and 1 deletions

View file

@ -339,3 +339,12 @@ MEDIAN(f3) OVER ()
112.0000000000
112.0000000000
DROP TABLE t1;
#
# MDEV-15846: Sever crashed with MEDIAN() window function
#
CREATE TABLE t1 ( pk int PRIMARY KEY, a1 int, a2 int);
SELECT MEDIAN(`a1`) OVER (),
MEDIAN(`a2`) OVER (PARTITION BY `pk`)
FROM t1;
MEDIAN(`a1`) OVER () MEDIAN(`a2`) OVER (PARTITION BY `pk`)
DROP TABLE t1;

View file

@ -115,5 +115,15 @@ INSERT INTO t1(f1,f2,f3,f4) VALUES
WITH CTE AS (SELECT MIN(f3) OVER () FROM t1)
SELECT MEDIAN(f3) OVER () FROM t1
ORDER BY f1, f2, f3, f4, v1;
DROP TABLE t1;
--echo #
--echo # MDEV-15846: Sever crashed with MEDIAN() window function
--echo #
CREATE TABLE t1 ( pk int PRIMARY KEY, a1 int, a2 int);
SELECT MEDIAN(`a1`) OVER (),
MEDIAN(`a2`) OVER (PARTITION BY `pk`)
FROM t1;
DROP TABLE t1;