diff options
Diffstat (limited to 'sql/sql_lex.h')
-rw-r--r-- | sql/sql_lex.h | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 4f60f89ff36..ca72770e13b 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1029,6 +1029,10 @@ Field_pair *get_corresponding_field_pair(Item *item, Field_pair *find_matching_field_pair(Item *item, List<Field_pair> pair_list); +#define TOUCHED_SEL_COND 1/* WHERE/HAVING/ON should be reinited before use */ +#define TOUCHED_SEL_DERIVED (1<<1)/* derived should be reinited before use */ + + /* SELECT_LEX - store information of parsed SELECT statment */ @@ -1234,7 +1238,8 @@ public: subquery. Prepared statements work OK in that regard, as in case of an error during prepare the PS is not created. */ - bool first_execution; + uint8 changed_elements; // see TOUCHED_SEL_* + /* TODO: add foloowing first_* to bitmap above */ bool first_natural_join_processing; bool first_cond_optimization; /* do not wrap view fields with Item_ref */ @@ -4310,6 +4315,31 @@ public: bool tmp_table() const { return create_info.tmp_table(); } bool if_exists() const { return create_info.if_exists(); } + /* + 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; + } + SELECT_LEX *exclude_last_select(); SELECT_LEX *exclude_not_first_select(SELECT_LEX *exclude); void check_automatic_up(enum sub_select_type type); |