diff options
author | Igor Babaev <igor@askmonty.org> | 2018-05-17 15:47:17 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2018-05-17 15:47:48 -0700 |
commit | d309c2fc885a5d50645ca9b43da2fda09f8b4418 (patch) | |
tree | 3700a16094b80de73e6ecb98fe7e74f4d0fd687f /mysql-test/r | |
parent | ab9d420df37d76a1ff68e6fd2d5bf53a797c4102 (diff) | |
download | mariadb-git-d309c2fc885a5d50645ca9b43da2fda09f8b4418.tar.gz |
MDEV-16212 Memory leak with recursive CTE that uses global ORDER BY
with recursive subquery
There were two problems:
1. The code did not report that usage of global ORDER BY / LIMIT clauses
was not supported yet.
2. The code just reset fake_select_lex of the the unit specifying
a recursive CTE to NULL and that caused memory leaks in some cases.
Diffstat (limited to 'mysql-test/r')
-rw-r--r-- | mysql-test/r/cte_recursive.result | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mysql-test/r/cte_recursive.result b/mysql-test/r/cte_recursive.result index d6dfdf1ec6a..b7516b88f9a 100644 --- a/mysql-test/r/cte_recursive.result +++ b/mysql-test/r/cte_recursive.result @@ -3233,3 +3233,13 @@ Parent Child Path 654 987 987, 321 654 987,654, DROP TABLE t1; +# +# MDEV-16212: recursive CTE with global ORDER BY +# +set statement max_recursive_iterations = 2 for +WITH RECURSIVE qn AS ( +SELECT 1 FROM dual UNION ALL +SELECT 1 FROM qn +ORDER BY (SELECT * FROM qn)) +SELECT count(*) FROM qn; +ERROR 42000: This version of MariaDB doesn't yet support 'global ORDER_BY/LIMIT in recursive CTE spec' |