mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext
This commit is contained in:
@ -45,6 +45,16 @@ private:
|
||||
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;
|
||||
/*
|
||||
Dependency map built only for the top level references i.e. for those that
|
||||
are encountered in from lists of the selects of the specification unit
|
||||
*/
|
||||
table_map top_level_dep_map;
|
||||
/*
|
||||
Points to a recursive reference in subqueries.
|
||||
Used only for specifications without recursive references on the top level.
|
||||
*/
|
||||
TABLE_LIST *sq_rec_ref;
|
||||
/*
|
||||
The next with element from the circular chain of the with elements
|
||||
mutually recursive with this with element.
|
||||
@ -119,11 +129,15 @@ public:
|
||||
*/
|
||||
select_union_recursive *rec_result;
|
||||
|
||||
/* List of Item_subselects containing recursive references to this CTE */
|
||||
SQL_I_List<Item_subselect> sq_with_rec_ref;
|
||||
|
||||
With_element(LEX_CSTRING *name,
|
||||
List <LEX_CSTRING> list,
|
||||
st_select_lex_unit *unit)
|
||||
: next(NULL), base_dep_map(0), derived_dep_map(0),
|
||||
sq_dep_map(0), work_dep_map(0), mutually_recursive(0),
|
||||
top_level_dep_map(0), sq_rec_ref(NULL),
|
||||
next_mutually_recursive(NULL), references(0),
|
||||
query_name(name), column_list(list), spec(unit),
|
||||
is_recursive(false), with_anchor(false),
|
||||
@ -151,6 +165,8 @@ public:
|
||||
bool check_dependency_on(With_element *with_elem)
|
||||
{ return base_dep_map & with_elem->get_elem_map(); }
|
||||
|
||||
TABLE_LIST *find_first_sq_rec_ref_in_select(st_select_lex *sel);
|
||||
|
||||
bool set_unparsed_spec(THD *thd, char *spec_start, char *spec_end);
|
||||
|
||||
st_select_lex_unit *clone_parsed_spec(THD *thd, TABLE_LIST *with_table);
|
||||
@ -174,11 +190,16 @@ public:
|
||||
bool contains_sq_with_recursive_reference()
|
||||
{ return sq_dep_map & mutually_recursive; }
|
||||
|
||||
bool no_rec_ref_on_top_level()
|
||||
{ return !(top_level_dep_map & mutually_recursive); }
|
||||
|
||||
table_map get_mutually_recursive() { return mutually_recursive; }
|
||||
|
||||
With_element *get_next_mutually_recursive()
|
||||
{ return next_mutually_recursive; }
|
||||
|
||||
TABLE_LIST *get_sq_rec_ref() { return sq_rec_ref; }
|
||||
|
||||
bool is_anchor(st_select_lex *sel);
|
||||
|
||||
void move_anchors_ahead();
|
||||
|
Reference in New Issue
Block a user