1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

MDEV-15894 Error, while using aggregated functions/window functions in anchor part

Usage of aggregate/window functions in non-recursive parts of recursive CTEs
is allowed. Error messages complaining about this were reported by mistake.
This commit is contained in:
Igor Babaev
2018-04-17 10:35:55 -07:00
parent e34d3184fd
commit 1d98333ad9
3 changed files with 39 additions and 1 deletions

View File

@@ -1173,7 +1173,7 @@ bool st_select_lex::check_unrestricted_recursive(bool only_standard_compliant)
/* Check conditions 3-4 for restricted specification*/
if (with_sum_func ||
if ((with_sum_func && !with_elem->is_anchor(this)) ||
(with_elem->contains_sq_with_recursive_reference()))
with_elem->get_owner()->add_unrestricted(
with_elem->get_mutually_recursive());