MySQL  8.0.17
Source Code Documentation
Query_result_union Class Reference

#include <sql_union.h>

Inheritance diagram for Query_result_union:
Query_result_interceptor Query_result Query_result_materialize Query_result_union_direct

Public Member Functions

 Query_result_union ()
 
bool prepare (THD *thd, List< Item > &list, SELECT_LEX_UNIT *u) override
 Perform preparation specific to the query expression or DML statement. More...
 
virtual bool postponed_prepare (THD *thd, List< Item > &types)
 Do prepare() if preparation has been postponed until column type information is computed (used by Query_result_union_direct). More...
 
bool send_data (THD *thd, List< Item > &items) override
 
bool send_eof (THD *thd) override
 
virtual bool flush ()
 
void cleanup (THD *) override
 Cleanup after this execution. More...
 
bool reset () override
 Reset and empty the temporary table that stores the materialized query result. More...
 
bool create_result_table (THD *thd, List< Item > *column_types, bool is_distinct, ulonglong options, const char *alias, bool bit_fields_as_long, bool create_table)
 Create a temporary table to store the result of Query_result_union. More...
 
virtual const ha_rowsrow_count () const override
 
- Public Member Functions inherited from Query_result_interceptor
 Query_result_interceptor ()
 
uint field_count (List< Item > &) const override
 
bool send_result_set_metadata (THD *, List< Item > &, uint) override
 
bool is_interceptor () const override final
 Checks if this Query_result intercepts and transforms the result set. More...
 
- Public Member Functions inherited from Query_result
 Query_result ()
 
virtual ~Query_result ()
 
virtual bool needs_file_privilege () const
 
virtual bool change_query_result (THD *, Query_result *)
 Change wrapped Query_result. More...
 
virtual bool need_explain_interceptor () const
 
virtual bool optimize ()
 Optimize the result processing of a query expression, applicable to data change operation (not simple select queries). More...
 
virtual bool start_execution (THD *)
 Prepare for execution of the query expression or DML statement. More...
 
virtual void send_error (THD *, uint errcode, const char *err)
 
virtual bool check_simple_select () const
 Check if this query returns a result set and therefore is allowed in cursors and set an error message if it is not the case. More...
 
virtual void abort_result_set (THD *)
 
void begin_dataset ()
 

Public Attributes

TABLEtable
 
- Public Attributes inherited from Query_result
ha_rows estimated_rowcount
 Number of records estimated in this result. More...
 
double estimated_cost
 Cost to execute the subquery which produces this result. More...
 

Private Attributes

Temp_table_param tmp_table_param
 
ha_rows m_rows_in_table
 Count of rows successfully stored in tmp table. More...
 

Friends

bool TABLE_LIST::create_materialized_table (THD *thd)
 

Additional Inherited Members

- Protected Attributes inherited from Query_result
SELECT_LEX_UNITunit
 

Constructor & Destructor Documentation

◆ Query_result_union()

Query_result_union::Query_result_union ( )
inline

Member Function Documentation

◆ cleanup()

void Query_result_union::cleanup ( THD )
inlineoverridevirtual

Cleanup after this execution.

Completes the execution and resets object before next execution of a prepared statement/stored procedure.

Reimplemented from Query_result.

◆ create_result_table()

bool Query_result_union::create_result_table ( THD thd_arg,
List< Item > *  column_types,
bool  is_union_distinct,
ulonglong  options,
const char *  table_alias,
bool  bit_fields_as_long,
bool  create_table 
)

Create a temporary table to store the result of Query_result_union.

Parameters
thd_argthread handle
column_typesa list of items used to define columns of the temporary table
is_union_distinctif set, the temporary table will eliminate duplicates on insert
optionscreate options
table_aliasname of the temporary table
bit_fields_as_longconvert bit fields to ulonglong
create_tableIf false, a table handler will not be created when creating the result table.

Create a temporary table that is used to store the result of a UNION, derived table, or a materialized cursor.

Returns
false if table created, true if error

◆ flush()

bool Query_result_union::flush ( )
virtual

Reimplemented in Query_result_union_direct.

◆ postponed_prepare()

virtual bool Query_result_union::postponed_prepare ( THD thd,
List< Item > &  types 
)
inlinevirtual

Do prepare() if preparation has been postponed until column type information is computed (used by Query_result_union_direct).

Parameters
thdThread handle
typesColumn types
Returns
false on success, true on failure

Reimplemented in Query_result_union_direct.

◆ prepare()

bool Query_result_union::prepare ( THD ,
List< Item > &  ,
SELECT_LEX_UNIT u 
)
overridevirtual

Perform preparation specific to the query expression or DML statement.

Returns
false if success, true if error

Reimplemented from Query_result.

◆ reset()

bool Query_result_union::reset ( void  )
overridevirtual

Reset and empty the temporary table that stores the materialized query result.

Note
The cleanup performed here is exactly the same as for the two temp tables of JOIN - exec_tmp_table_[1 | 2].

Reimplemented from Query_result.

◆ row_count()

virtual const ha_rows* Query_result_union::row_count ( ) const
inlineoverridevirtual
Returns
Pointer to count of rows retained by this result.

Reimplemented from Query_result.

◆ send_data()

bool Query_result_union::send_data ( THD thd,
List< Item > &  items 
)
overridevirtual

Implements Query_result.

◆ send_eof()

bool Query_result_union::send_eof ( THD thd)
overridevirtual

Implements Query_result.

Friends And Related Function Documentation

◆ TABLE_LIST::create_materialized_table

Member Data Documentation

◆ m_rows_in_table

ha_rows Query_result_union::m_rows_in_table
private

Count of rows successfully stored in tmp table.

◆ table

TABLE* Query_result_union::table

◆ tmp_table_param

Temp_table_param Query_result_union::tmp_table_param
private

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