mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
MDEV-20632: Recursive CTE cycle detection using CYCLE clause (nonstandard)
Added CYCLE ... RESTRICT (nonstandard) clause to recursive CTE.
This commit is contained in:
@@ -112,6 +112,7 @@ public:
|
||||
always empty.
|
||||
*/
|
||||
List <Lex_ident_sys> column_list;
|
||||
List <Lex_ident_sys> *cycle_list;
|
||||
/* The query that specifies the table introduced by this with element */
|
||||
st_select_lex_unit *spec;
|
||||
/*
|
||||
@@ -169,7 +170,7 @@ public:
|
||||
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),
|
||||
query_name(name), column_list(list), cycle_list(0), spec(unit),
|
||||
is_recursive(false), rec_outer_references(0), with_anchor(false),
|
||||
level(0), rec_result(NULL)
|
||||
{ unit->with_element= this; }
|
||||
@@ -206,7 +207,7 @@ public:
|
||||
|
||||
void inc_references() { references++; }
|
||||
|
||||
bool rename_columns_of_derived_unit(THD *thd, st_select_lex_unit *unit);
|
||||
bool process_columns_of_derived_unit(THD *thd, st_select_lex_unit *unit);
|
||||
|
||||
bool prepare_unreferenced(THD *thd);
|
||||
|
||||
@@ -214,7 +215,7 @@ public:
|
||||
table_map &unrestricted,
|
||||
table_map &encountered);
|
||||
|
||||
void print(String *str, enum_query_type query_type);
|
||||
void print(THD *thd, String *str, enum_query_type query_type);
|
||||
|
||||
With_clause *get_owner() { return owner; }
|
||||
|
||||
@@ -259,6 +260,8 @@ public:
|
||||
|
||||
void prepare_for_next_iteration();
|
||||
|
||||
void set_cycle_list(List<Lex_ident_sys> *cycle_list_arg);
|
||||
|
||||
friend class With_clause;
|
||||
};
|
||||
|
||||
@@ -353,7 +356,7 @@ public:
|
||||
|
||||
void add_unrestricted(table_map map) { unrestricted|= map; }
|
||||
|
||||
void print(String *str, enum_query_type query_type);
|
||||
void print(THD *thd, String *str, enum_query_type query_type);
|
||||
|
||||
friend class With_element;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user