My Project
Public Types | Public Member Functions | Public Attributes | Protected Attributes | Friends
Item_subselect Class Reference
Inheritance diagram for Item_subselect:
Item_result_field Item Item_exists_subselect Item_singlerow_subselect Item_in_subselect Item_maxmin_subselect Item_allany_subselect

List of all members.

Public Types

enum  trans_res { RES_OK, RES_REDUCE, RES_ERROR }
enum  subs_type {
  UNKNOWN_SUBS, SINGLEROW_SUBS, EXISTS_SUBS, IN_SUBS,
  ALL_SUBS, ANY_SUBS
}

Public Member Functions

const subselect_engineget_engine_for_explain () const
 EXPLAIN needs read-only access to the engine.
virtual subs_type substype ()
virtual void init (st_select_lex *select_lex, select_result_interceptor *result)
virtual void cleanup ()
virtual void reset ()
virtual trans_res select_transformer (JOIN *join)
bool assigned () const
void assigned (bool a)
enum Type type () const
bool is_null ()
bool fix_fields (THD *thd, Item **ref)
void fix_after_pullout (st_select_lex *parent_select, st_select_lex *removed_select)
virtual bool exec ()
virtual void fix_length_and_dec ()
table_map used_tables () const
table_map not_null_tables () const
bool const_item () const
table_map get_used_tables_cache ()
bool get_const_item_cache ()
Itemget_tmp_table_item (THD *thd)
void update_used_tables ()
virtual void print (String *str, enum_query_type query_type)
virtual bool have_guarded_conds ()
bool change_engine (subselect_engine *eng)
bool is_evaluated () const
bool is_uncacheable () const
virtual void reset_value_registration ()
enum_parsing_place place ()
bool walk_join_condition (List< TABLE_LIST > *tables, Item_processor processor, bool walk_subquery, uchar *argument)
bool walk_body (Item_processor processor, bool walk_subquery, uchar *arg)
bool walk (Item_processor processor, bool walk_subquery, uchar *arg)
virtual bool explain_subquery_checker (uchar **arg)
bool inform_item_in_cond_of_tab (uchar *join_tab_index)
virtual bool clean_up_after_removal (uchar *arg)
const char * func_name () const

Public Attributes

Itemsubstitution
st_select_lex_unit * unit
int in_cond_of_tab
bool engine_changed
bool changed

Protected Attributes

subselect_engineengine
subselect_engineold_engine
table_map used_tables_cache
uint max_columns
enum_parsing_place parsing_place
bool have_to_be_excluded
bool const_item_cache

Friends

class select_result_interceptor
class Item_in_optimizer
bool Item_field::fix_fields (THD *, Item **)
int Item_field::fix_outer_field (THD *, Field **, Item **)
bool Item_ref::fix_fields (THD *, Item **)
void Item_ident::fix_after_pullout (st_select_lex *parent_select, st_select_lex *removed_selec)
void mark_select_range_as_dependent (THD *, st_select_lex *, st_select_lex *, Field *, Item *, Item_ident *)

Member Function Documentation

bool Item_subselect::clean_up_after_removal ( uchar *  arg) [virtual]

Clean up after removing the subquery from the item tree.

Call st_select_lex_unit::exclude_tree() to unlink it from its master and to unlink direct st_select_lex children from all_selects_list.

Don't unlink subqueries that are not descendants of the starting point (root) of the removal and cleanup.

Reimplemented from Item.

bool Item_subselect::explain_subquery_checker ( uchar **  arg) [virtual]

Mark a subquery unit with information provided

A subquery may belong to WHERE, HAVING, ORDER BY or GROUP BY item trees. This "processor" qualifies subqueries by outer clause type.

Note:
For the WHERE clause of the JOIN query this function also associates a related table with the unit.
Parameters:
argExplain_subquery_marker structure
Return values:
false
Note:
We always return "false" as far as we don't want to dive deeper because we explain inner subqueries in their joins contexts.

Reimplemented from Item.

void Item_subselect::fix_after_pullout ( st_select_lex *  parent_select,
st_select_lex *  removed_select 
) [virtual]

Fix used tables information for a subquery after query transformations. Common actions for all predicates involving subqueries. Most actions here involve re-resolving information for conditions and items belonging to the subquery. Notice that the usage information from underlying expressions is not propagated to the subquery predicate, as it belongs to inner layers of the query operator structure. However, when underlying expressions contain outer references into a select_lex on this level, the relevant information must be updated when these expressions are resolved.

Reimplemented from Item.

Reimplemented in Item_in_subselect.

bool Item_subselect::inform_item_in_cond_of_tab ( uchar *  join_tab_index) [virtual]

Tells an Item that it is in the condition of a JOIN_TAB

Parameters:
'join_tab_index'index of JOIN_TAB in JOIN's array

The Item records this fact and can deduce from it the estimated number of times that it will be evaluated.

Reimplemented from Item.

void Item_subselect::print ( String str,
enum_query_type  query_type 
) [virtual]

This method is used for to:

  • to generate a view definition query (SELECT-statement);
  • to generate a SQL-query for EXPLAIN EXTENDED;
  • to generate a SQL-query to be shown in INFORMATION_SCHEMA;
  • debug.

For more information about view definition query, INFORMATION_SCHEMA query and why they should be generated from the Item-tree,

See also:
mysql_register_view().

Reimplemented from Item.

Reimplemented in Item_allany_subselect, Item_in_subselect, Item_exists_subselect, and Item_maxmin_subselect.

bool Item_subselect::walk_body ( Item_processor  processor,
bool  walk_subquery,
uchar *  argument 
)

Workaround for bug in gcc 4.1. Item_in_subselect::walk()

bool Item_subselect::walk_join_condition ( List< TABLE_LIST > *  tables,
Item_processor  processor,
bool  walk_subquery,
uchar *  argument 
)

Apply walk() processor to join conditions.

JOINs may be nested. Walk nested joins recursively to apply the processor.


Member Data Documentation

If !=INT_MIN: this Item is in the condition attached to the JOIN_TAB having this index in the parent JOIN.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines