summaryrefslogtreecommitdiff
path: root/mysql-test/main/win.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/main/win.test')
-rw-r--r--mysql-test/main/win.test16
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/main/win.test b/mysql-test/main/win.test
index 37d2b616dda..bc2f6144985 100644
--- a/mysql-test/main/win.test
+++ b/mysql-test/main/win.test
@@ -2507,6 +2507,22 @@ SELECT cast((rank() over w1) as decimal (53,56));
SELECT cast((rank() over w1) as decimal (53,30));
--echo #
+--echo # MDEV-15180: server crashed with NTH_VALUE()
+--echo #
+
+CREATE TABLE t1 (i1 int, a int);
+INSERT INTO t1 VALUES (1, 1), (2, 2),(3, 3);
+
+CREATE TABLE t2 (i2 int);
+INSERT INTO t2 VALUES (1),(2),(5),(1),(7),(4),(3);
+
+CREATE VIEW v1 AS (SELECT * FROM t1,t2 WHERE t1.i1=t2.i2) ;
+SELECT NTH_VALUE(i1, i1) OVER (PARTITION BY i1) FROM v1;
+
+DROP VIEW v1;
+DROP TABLE t1,t2;
+
+--echo #
--echo # End of 10.2 tests
--echo #