summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2021-05-22 15:53:33 +0300
committerSergei Petrunia <psergey@askmonty.org>2021-06-09 15:52:13 +0300
commitc872125a664842ecfb66c60f69b3a87390aec23d (patch)
tree37082f17534e163ed8defbe32687be5abcaaaf4b /mysql-test/t
parentdfa2d0bc13362b949b1b1699955583f74e7db90a (diff)
downloadmariadb-git-c872125a664842ecfb66c60f69b3a87390aec23d.tar.gz
MDEV-25630: Crash with window function in left expr of IN subquery
* Make Item_in_optimizer::fix_fields inherit the with_window_func attribute of the subquery's left expression (the subquery itself cannot have window functions that are aggregated in this select) * Make Item_cache_wrapper::Item_cache_wrapper() inherit with_window_func attribute of the item it is caching.
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/win.test14
1 files changed, 14 insertions, 0 deletions
diff --git a/mysql-test/t/win.test b/mysql-test/t/win.test
index 57214ab0165..c07a81f17da 100644
--- a/mysql-test/t/win.test
+++ b/mysql-test/t/win.test
@@ -2543,5 +2543,19 @@ order by rn desc;
drop table t1;
--echo #
+--echo # MDEV-25630: Crash with window function in left expr of IN subquery
+--echo #
+
+CREATE TABLE t1 (i int);
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT lag(i) over (ORDER BY i) IN ( SELECT 1 FROM t1 a) FROM t1;
+DROP TABLE t1;
+
+CREATE TABLE t1 (i int);
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT sum(i) over () IN ( SELECT 1 FROM t1 a) FROM t1;
+DROP TABLE t1;
+
+--echo #
--echo # End of 10.2 tests
--echo #