Commit 6b1a8b2c authored by Varun Gupta's avatar Varun Gupta

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

Fixed by MDEV-15902, just added the test case for this issue.
parent c058117c
......@@ -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;
......@@ -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;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment