summaryrefslogtreecommitdiff
path: root/sql/sql_cte.h
diff options
context:
space:
mode:
authorGalina Shalygina <galashalygina@gmail.com>2016-05-12 23:23:12 +0300
committerGalina Shalygina <galashalygina@gmail.com>2016-05-12 23:23:12 +0300
commitd9b332bd2009cc520534bb9413e2f50c717237aa (patch)
tree483913747409a69096cc30705bc056dc53bf9976 /sql/sql_cte.h
parentd0e973a3b0fc4384b8aeebfa6509a653b07b7eac (diff)
downloadmariadb-git-d9b332bd2009cc520534bb9413e2f50c717237aa.tar.gz
Made prepared statement, explain and views working with recursuve CTE.
Diffstat (limited to 'sql/sql_cte.h')
-rw-r--r--sql/sql_cte.h23
1 files changed, 14 insertions, 9 deletions
diff --git a/sql/sql_cte.h b/sql/sql_cte.h
index b559be93de5..0312fcd0643 100644
--- a/sql/sql_cte.h
+++ b/sql/sql_cte.h
@@ -82,9 +82,8 @@ public:
uint level;
- select_union *partial_result;
- select_union *final_result;
select_union_recursive *rec_result;
+
TABLE *result_table;
With_element(LEX_STRING *name,
@@ -95,9 +94,8 @@ public:
references(0), table(NULL),
query_name(name), column_list(list), spec(unit),
is_recursive(false), with_anchor(false),
- partial_result(NULL), final_result(NULL),
- rec_result(NULL), result_table(NULL)
- { reset();}
+ level(0), rec_result(NULL), result_table(NULL)
+ {}
bool check_dependencies_in_spec(THD *thd);
@@ -147,10 +145,7 @@ public:
void mark_as_cleaned();
- void reset()
- {
- level= 0;
- }
+ void reset_for_exec();
void set_result_table(TABLE *tab) { result_table= tab; }
@@ -284,4 +279,14 @@ void With_element::mark_as_cleaned()
owner->cleaned|= get_elem_map();
}
+
+inline
+void With_element::reset_for_exec()
+{
+ level= 0;
+ owner->with_prepared_anchor&= ~mutually_recursive;
+ owner->cleaned&= ~get_elem_map();
+}
+
+
#endif /* SQL_CTE_INCLUDED */