diff options
author | Galina Shalygina <galashalygina@gmail.com> | 2016-05-19 22:07:53 +0300 |
---|---|---|
committer | Galina Shalygina <galashalygina@gmail.com> | 2016-05-19 22:07:53 +0300 |
commit | 46a2e4139830d176c31be1c53e533167ea4f95b9 (patch) | |
tree | bb940fefff718b925609a85dabba3ba86c26cf50 /sql/sql_cte.h | |
parent | 3b47632bfc74a548c2f0a057f39e99a8a761a57a (diff) | |
download | mariadb-git-46a2e4139830d176c31be1c53e533167ea4f95b9.tar.gz |
Fixed many problems in the code of With_element::check_unrestricted_recursive().
Added the check whether there are set functions in the specifications of recursive CTE.
Added the check whether there are recursive references in subqueries.
Introduced boolean system variable 'standards_compliant_cte'. By default it's set to 'on'.
When it's set to 'off' non-standard compliant CTE can be executed.
Diffstat (limited to 'sql/sql_cte.h')
-rw-r--r-- | sql/sql_cte.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sql/sql_cte.h b/sql/sql_cte.h index 0312fcd0643..1c32f16258c 100644 --- a/sql/sql_cte.h +++ b/sql/sql_cte.h @@ -35,6 +35,7 @@ private: directly or indirectly from the i-th with element. */ table_map derived_dep_map; + table_map sq_dep_map; table_map work_dep_map; // dependency map used for work /* Dependency map of with elements mutually recursive with this with element */ table_map mutually_recursive; @@ -90,7 +91,7 @@ public: List <LEX_STRING> list, st_select_lex_unit *unit) : next_elem(NULL), base_dep_map(0), derived_dep_map(0), - work_dep_map(0), mutually_recursive(0), + sq_dep_map(0), work_dep_map(0), mutually_recursive(0), references(0), table(NULL), query_name(name), column_list(list), spec(unit), is_recursive(false), with_anchor(false), @@ -151,7 +152,8 @@ public: friend class With_clause; friend - bool st_select_lex::check_unrestricted_recursive(); + bool + st_select_lex::check_unrestricted_recursive(bool only_standard_compliant); friend bool TABLE_LIST::is_with_table_recursive_reference(); }; @@ -241,9 +243,11 @@ public: friend class With_element; friend - bool check_dependencies_in_with_clauses(THD *thd, With_clause *with_clauses_list); + bool + check_dependencies_in_with_clauses(THD *thd, With_clause *with_clauses_list); friend - bool st_select_lex::check_unrestricted_recursive(); + bool + st_select_lex::check_unrestricted_recursive(bool only_standard_compliant); }; |