MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
subselect_single_select_engine Class Reference
Inheritance diagram for subselect_single_select_engine:
Collaboration diagram for subselect_single_select_engine:

Public Member Functions

 subselect_single_select_engine (st_select_lex *select, select_result_interceptor *result, Item_subselect *item)
virtual void cleanup ()
virtual bool prepare ()
virtual void fix_length_and_dec (Item_cache **row)
virtual bool exec ()
virtual uint cols () const
virtual uint8 uncacheable () const
virtual void exclude ()
virtual table_map upper_select_const_tables () const
virtual void print (String *str, enum_query_type query_type)
virtual bool change_result (Item_subselect *si, select_result_interceptor *result)
virtual bool no_tables () const
virtual bool may_be_null () const
virtual bool is_executed () const
virtual enum_engine_type engine_type () const
- Public Member Functions inherited from subselect_engine
 subselect_engine (Item_subselect *si, select_result_interceptor *res)
void set_thd_for_result ()
 Sets "thd" for 'result'. Should be called before prepare()
virtual enum Item_result type () const
virtual enum_field_types field_type () const
const Item_subselectget_item () const

Friends

class subselect_hash_sj_engine
class Item_in_subselect

Additional Inherited Members

- Public Types inherited from subselect_engine
enum  enum_engine_type {
  ABSTRACT_ENGINE, SINGLE_SELECT_ENGINE, UNION_ENGINE, UNIQUESUBQUERY_ENGINE,
  INDEXSUBQUERY_ENGINE, HASH_SJ_ENGINE
}
- Static Public Member Functions inherited from subselect_engine
static table_map calc_const_tables (TABLE_LIST *)
- Protected Member Functions inherited from subselect_engine
void set_row (List< Item > &item_list, Item_cache **row)
- Protected Attributes inherited from subselect_engine
select_result_interceptor * result
Item_subselectitem
enum Item_result res_type
enum_field_types res_field_type
bool maybe_null

Detailed Description

Definition at line 586 of file item_subselect.h.

Member Function Documentation

bool subselect_single_select_engine::change_result ( Item_subselect si,
select_result_interceptor *  res 
)
virtual

change select_result object of engine.

Parameters
sinew subselect Item
resnew select_result object
Return values
FALSEOK
TRUEerror

Implements subselect_engine.

Definition at line 3349 of file item_subselect.cc.

void subselect_single_select_engine::cleanup ( )
virtual

Cleanup engine after complete query execution, free all resources.

Implements subselect_engine.

Definition at line 2558 of file item_subselect.cc.

Here is the call graph for this function:

Here is the caller graph for this function:

bool subselect_single_select_engine::no_tables ( ) const
virtual

Report about presence of tables in subquery.

Return values
TRUEthere are not tables used in subquery
FALSEthere are some tables in subquery

Implements subselect_engine.

Definition at line 3408 of file item_subselect.cc.

bool subselect_single_select_engine::prepare ( )
virtual

Create and prepare the JOIN object that represents the query execution plan for the subquery.

This method is called from Item_subselect::fix_fields. For prepared statements it is called both during the PREPARE and EXECUTE phases in the following ways:

  • During PREPARE the optimizer needs some properties (join->fields_list.elements) of the JOIN to proceed with preparation of the remaining query (namely to complete ::fix_fields for the subselect related classes. In the end of PREPARE the JOIN is deleted.
  • When we EXECUTE the query, Item_subselect::fix_fields is called again, and the JOIN object is re-created again, prepared and executed. In the end of execution it is deleted. In all cases the JOIN is created in runtime memory (not in the permanent memory root).
Todo:
Re-check what properties of 'join' are needed during prepare, and see if we can avoid creating a JOIN during JOIN::prepare of the outer join.
Return values
0if success
1if error

Implements subselect_engine.

Definition at line 2618 of file item_subselect.cc.

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: