MySQL  8.0.17
Source Code Documentation
Query_result_create Class Referencefinal

#include <sql_insert.h>

Inheritance diagram for Query_result_create:
Query_result_insert Query_result_interceptor Query_result

Public Member Functions

 Query_result_create (TABLE_LIST *table_arg, HA_CREATE_INFO *create_info_par, Alter_info *alter_info_arg, List< Item > &select_fields, enum_duplicates duplic, TABLE_LIST *select_tables_arg)
 
bool prepare (THD *thd, List< Item > &list, SELECT_LEX_UNIT *u) override
 Create the new table from the selected items. More...
 
void store_values (THD *thd, List< Item > &values) override
 
void send_error (THD *thd, uint errcode, const char *err) override
 
bool send_eof (THD *thd) override
 
void abort_result_set (THD *thd) override
 
bool start_execution (THD *thd) override
 Lock the newly created table and prepare it for insertion. More...
 
- Public Member Functions inherited from Query_result_insert
 Query_result_insert (TABLE_LIST *table_list_par, TABLE *table_par, List< Item > *target_columns, List< Item > *target_or_source_columns, List< Item > *update_fields, List< Item > *update_values, enum_duplicates duplic)
 
Creates a Query_result_insert for routing a result set to an existing table. More...
 
bool need_explain_interceptor () const override
 
bool send_data (THD *thd, List< Item > &items) override
 
void cleanup (THD *thd) override
 Cleanup after this execution. More...
 
- 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 optimize ()
 Optimize the result processing of a query expression, applicable to data change operation (not simple select queries). More...
 
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 bool reset ()
 Cleanup after one execution of the unit, to be ready for a next execution inside the same statement. More...
 
void begin_dataset ()
 
virtual const ha_rowsrow_count () const
 

Private Member Functions

bool stmt_binlog_is_trans () const override
 Indicates whether this statement should be written to binary log's transactional cache in statement mode. More...
 
int binlog_show_create_table (THD *thd)
 
void drop_open_table (THD *thd)
 Close and drop just created table in CREATE TABLE ... More...
 

Private Attributes

TABLE_LISTcreate_table
 
HA_CREATE_INFOcreate_info
 
TABLE_LISTselect_tables
 
Alter_infoalter_info
 
Field ** field
 
MYSQL_LOCKm_lock
 
MYSQL_LOCK ** m_plock
 
handlertonm_post_ddl_ht
 If table being created has SE supporting atomic DDL, pointer to SE's handlerton object to be used for calling SE post-DDL hook, nullptr - otherwise. More...
 

Additional Inherited Members

- Public Attributes inherited from Query_result_insert
TABLE_LISTtable_list
 The table used for insertion of rows. More...
 
TABLEtable
 
ulonglong autoinc_value_of_last_inserted_row
 
COPY_INFO info
 
COPY_INFO update
 the UPDATE part of "info" More...
 
bool insert_into_view
 
- 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...
 
- Protected Attributes inherited from Query_result_insert
bool bulk_insert_started
 ha_start_bulk_insert has been called. Never cleared. More...
 
- Protected Attributes inherited from Query_result
SELECT_LEX_UNITunit
 

Detailed Description

This is not in line with good programming practices and the inheritance should be broken up.

Constructor & Destructor Documentation

◆ Query_result_create()

Query_result_create::Query_result_create ( TABLE_LIST table_arg,
HA_CREATE_INFO create_info_par,
Alter_info alter_info_arg,
List< Item > &  select_fields,
enum_duplicates  duplic,
TABLE_LIST select_tables_arg 
)

Member Function Documentation

◆ abort_result_set()

void Query_result_create::abort_result_set ( THD thd)
overridevirtual

Reimplemented from Query_result_insert.

◆ binlog_show_create_table()

int Query_result_create::binlog_show_create_table ( THD thd)
private

◆ drop_open_table()

void Query_result_create::drop_open_table ( THD thd)
private

Close and drop just created table in CREATE TABLE ...

SELECT in case of error.

Note
Here we assume that the table to be closed is open only by the calling thread, so we needn't wait until other threads close the table. We also assume that the table is first in thd->open_ables and a data lock on it, if any, has been released.

◆ prepare()

bool Query_result_create::prepare ( THD thd,
List< Item > &  values,
SELECT_LEX_UNIT u 
)
overridevirtual

Create the new table from the selected items.

Parameters
thdThread handle.
valuesList of items to be used as new columns
uSelect
Returns
false if success, true if error.

Reimplemented from Query_result_insert.

◆ send_eof()

bool Query_result_create::send_eof ( THD thd)
overridevirtual

Reimplemented from Query_result_insert.

◆ send_error()

void Query_result_create::send_error ( THD thd,
uint  errcode,
const char *  err 
)
overridevirtual

Reimplemented from Query_result_insert.

◆ start_execution()

bool Query_result_create::start_execution ( THD thd)
overridevirtual

Lock the newly created table and prepare it for insertion.

Returns
false if success, true if error

Reimplemented from Query_result_insert.

◆ stmt_binlog_is_trans()

bool Query_result_create::stmt_binlog_is_trans ( ) const
overrideprivatevirtual

Indicates whether this statement should be written to binary log's transactional cache in statement mode.

Reimplemented from Query_result_insert.

◆ store_values()

void Query_result_create::store_values ( THD thd,
List< Item > &  values 
)
overridevirtual

Reimplemented from Query_result_insert.

Member Data Documentation

◆ alter_info

Alter_info* Query_result_create::alter_info
private

◆ create_info

HA_CREATE_INFO* Query_result_create::create_info
private

◆ create_table

TABLE_LIST* Query_result_create::create_table
private

◆ field

Field** Query_result_create::field
private

◆ m_lock

MYSQL_LOCK* Query_result_create::m_lock
private

◆ m_plock

MYSQL_LOCK** Query_result_create::m_plock
private

◆ m_post_ddl_ht

handlerton* Query_result_create::m_post_ddl_ht
private

If table being created has SE supporting atomic DDL, pointer to SE's handlerton object to be used for calling SE post-DDL hook, nullptr - otherwise.

◆ select_tables

TABLE_LIST* Query_result_create::select_tables
private

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