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

List of all members.

Public Types

enum  enum_exec_method {
  EXEC_UNSPECIFIED, EXEC_SEMI_JOIN, EXEC_EXISTS, EXEC_EXISTS_OR_MAT,
  EXEC_MATERIALIZATION
}

Public Member Functions

 Item_exists_subselect (st_select_lex *select_lex)
virtual trans_res select_transformer (JOIN *join)
subs_type substype ()
virtual void reset ()
enum Item_result result_type () const
longlong val_int ()
double val_real ()
Stringval_str (String *)
my_decimalval_decimal (my_decimal *)
bool val_bool ()
bool get_date (MYSQL_TIME *ltime, uint fuzzydate)
bool get_time (MYSQL_TIME *ltime)
void fix_length_and_dec ()
virtual void print (String *str, enum_query_type query_type)

Public Attributes

enum_exec_method exec_method
int sj_convert_priority
 Priority of this predicate in the convert-to-semi-join-nest process.
bool sj_chosen
 True if this predicate is chosen for semi-join transformation.
TABLE_LISTembedding_join_nest

Protected Attributes

bool value

Friends

class select_exists_subselect
class subselect_indexsubquery_engine

Member Enumeration Documentation

The method chosen to execute the predicate, currently used for IN, =ANY and EXISTS predicates.

Enumerator:
EXEC_UNSPECIFIED 

No execution method specified yet.

EXEC_SEMI_JOIN 

Predicate is converted to semi-join nest.

EXEC_EXISTS 

IN was converted to correlated EXISTS, and this is a final decision.

EXEC_EXISTS_OR_MAT 

Decision between EXEC_EXISTS and EXEC_MATERIALIZATION is not yet taken. IN was temporarily converted to correlated EXISTS. All descendants of Item_in_subselect must go through this method before they can reach EXEC_EXISTS.

EXEC_MATERIALIZATION 

Predicate executed via materialization, and this is a final decision.


Member Function Documentation

void Item_exists_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_subselect.

Reimplemented in Item_allany_subselect, and Item_in_subselect.

bool Item_exists_subselect::val_bool ( ) [virtual]
Todo:
Make this functions class dependent

Reimplemented from Item.

Reimplemented in Item_in_subselect.

my_decimal * Item_exists_subselect::val_decimal ( my_decimal decimal_value) [virtual]

Return the result of EXISTS as a decimal value

Converts the true/false result into a decimal value. Note that currently this cannot be NULL, so if the query exection fails it will return 0.

Parameters:
decimal_value[out]Buffer to hold the resulting decimal value
Return values:
Pointerto the converted decimal. Can't be a NULL pointer, as currently EXISTS cannot return NULL.

Implements Item.

Reimplemented in Item_in_subselect.

Return the result of EXISTS as a string value

Converts the true/false result into a string value. Note that currently this cannot be NULL, so if the query exection fails it will return 0.

Parameters:
decimal_value[out]buffer to hold the resulting string value
Return values:
Pointerto the converted string. Can't be a NULL pointer, as currently EXISTS cannot return NULL.

Implements Item.

Reimplemented in Item_in_subselect.


Member Data Documentation

Used by subquery optimizations to keep track about where this subquery predicate is located, and whether it is a candidate for transformation. (TABLE_LIST*) 1 - the predicate is an AND-part of the WHERE join nest pointer - the predicate is an AND-part of ON expression of a join nest NULL - for all other locations. It also means that the predicate is not a candidate for transformation. See also THD::emb_on_expr_nest.


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