summaryrefslogtreecommitdiff
path: root/mysql-test/main/win.test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-07-02 06:17:51 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-07-02 06:17:51 +0300
commit1df1a6392477ad211b2a66c6eccbe9d5c6316c7e (patch)
tree7f38ad7d6e69ea53fb9c887ff9aaa953f103ea54 /mysql-test/main/win.test
parent6d3747a294d75ab8153f82c5b2d61c3bf17b04de (diff)
parentdba7e1e8e14254c9de61e74b7e68cdbbad0038a8 (diff)
downloadmariadb-git-1df1a6392477ad211b2a66c6eccbe9d5c6316c7e.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/main/win.test')
-rw-r--r--mysql-test/main/win.test13
1 files changed, 13 insertions, 0 deletions
diff --git a/mysql-test/main/win.test b/mysql-test/main/win.test
index 6a9a93e903b..0b7778965ef 100644
--- a/mysql-test/main/win.test
+++ b/mysql-test/main/win.test
@@ -2460,6 +2460,19 @@ SELECT row_number() OVER() FROM t1;
DROP TABLE t1;
--echo #
+--echo # MDEV-22984: Throw an error when arguments to window functions are window functions
+--echo #
+
+CREATE TABLE t1(a INT, b INT);
+INSERT INTO t1 VALUES (1,1), (2,2), (3,3);
+
+--error ER_SUM_FUNC_WITH_WINDOW_FUNC_AS_ARG
+SELECT NTILE(MAX(a) OVER (PARTITION BY a)) OVER (PARTITION BY a ORDER BY b) FROM t1;
+--error ER_SUM_FUNC_WITH_WINDOW_FUNC_AS_ARG
+SELECT FIRST_VALUE(MAX(a) OVER (PARTITION BY a)) OVER (ORDER BY a) AS x FROM t1 GROUP BY a;
+DROP TABLE t1;
+
+--echo #
--echo # End of 10.2 tests
--echo #