diff options
author | Igor Babaev <igor@askmonty.org> | 2018-04-17 10:35:55 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2018-04-17 10:35:55 -0700 |
commit | 1d98333ad986d89215f903798a1787ab20308c6b (patch) | |
tree | f0901d00d29f9e9c9dbacd802c1bd4a638ea9daa /sql | |
parent | e34d3184fd02967616bb83904aa3c21977ce6205 (diff) | |
download | mariadb-git-1d98333ad986d89215f903798a1787ab20308c6b.tar.gz |
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.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_cte.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_cte.cc b/sql/sql_cte.cc index 6bc833b46a7..cd2516c2beb 100644 --- a/sql/sql_cte.cc +++ b/sql/sql_cte.cc @@ -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()); |