summaryrefslogtreecommitdiff
path: root/sql/sql_lex.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2019-02-28 18:13:28 +0400
committerAlexander Barkov <bar@mariadb.com>2019-02-28 18:13:28 +0400
commit0ad598a00b17008b0c0702db40948b14d7eee0d5 (patch)
tree4288555eee4e2fb9c427d8aa97ba762eb7c03b0f /sql/sql_lex.h
parentc9b9d9f5152b2ec16e88c0b235d50420c52b41de (diff)
downloadmariadb-git-0ad598a00b17008b0c0702db40948b14d7eee0d5.tar.gz
A cleanup in derived table handling: removing duplicate code from st_select_lex::handle_derived()
st_select_lex::handle_derived() and mysql_handle_list_of_derived() had exactly the same implementations. - Adding a new method LEX::handle_list_of_derived() instead - Removing public function mysql_handle_list_of_derived() - Reusing LEX::handle_list_of_derived() in st_select_lex::handle_derived()
Diffstat (limited to 'sql/sql_lex.h')
-rw-r--r--sql/sql_lex.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 57129cfedc7..8a31560d2bf 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -2785,6 +2785,31 @@ struct LEX: public Query_tables_list
}
bool save_prep_leaf_tables();
+
+ /*
+ Run specified phases for derived tables/views in the given list
+
+ @param table_list - list of derived tables/view to handle
+ @param phase - phases to process tables/views through
+
+ @details
+ This method runs phases specified by the 'phases' on derived
+ tables/views found in the 'table_list' with help of the
+ TABLE_LIST::handle_derived function.
+ 'this' is passed as an argument to the TABLE_LIST::handle_derived.
+
+ @return false - ok
+ @return true - error
+ */
+ bool handle_list_of_derived(TABLE_LIST *table_list, uint phases)
+ {
+ for (TABLE_LIST *tl= table_list; tl; tl= tl->next_local)
+ {
+ if (tl->is_view_or_derived() && tl->handle_derived(this, phases))
+ return true;
+ }
+ return false;
+ }
};