MySQL 9.0.0
Source Code Documentation
Query_result_create Class Referencefinal

#include <sql_insert.h>

Inheritance diagram for Query_result_create:
[legend]

Public Member Functions

 Query_result_create (Table_ref *create_table_arg, mem_root_deque< Item * > *fields, enum_duplicates duplic, Table_ref *select_tables_arg)
 
bool prepare (THD *thd, const mem_root_deque< Item * > &list, Query_expression *u) override
 Perform preparation specific to the query expression or DML statement. More...
 
void store_values (THD *thd, const mem_root_deque< Item * > &values) override
 
bool send_eof (THD *thd) override
 
void abort_result_set (THD *thd) override
 
bool create_table_for_query_block (THD *thd) override
 Create new table. More...
 
bool start_execution (THD *thd) override
 Lock the newly created table and prepare it for insertion. More...
 
void set_two_fields (HA_CREATE_INFO *create_info_arg, Alter_info *alter_info_arg)
 
- Public Member Functions inherited from Query_result_insert
 Query_result_insert (Table_ref *table_list_par, mem_root_deque< Item * > *target_columns, mem_root_deque< Item * > *target_or_source_columns, mem_root_deque< Item * > *update_fields, mem_root_deque< Item * > *update_values, enum_duplicates duplic)
 
bool need_explain_interceptor () const override
 
bool send_data (THD *thd, const mem_root_deque< Item * > &items) override
 
void cleanup () override
 Cleanup after this execution. More...
 
- Public Member Functions inherited from Query_result_interceptor
 Query_result_interceptor ()
 
uint field_count (const mem_root_deque< Item * > &) const override
 
bool send_result_set_metadata (THD *, const mem_root_deque< Item * > &, uint) override
 
- Public Member Functions inherited from Query_result
 Query_result ()
 
virtual ~Query_result ()=default
 
virtual bool needs_file_privilege () const
 
virtual bool change_query_result (THD *, Query_result *)
 Change wrapped Query_result. More...
 
virtual bool check_supports_cursor () const
 Check if this query result set supports cursors. More...
 
virtual bool reset ()
 Cleanup after one execution of the unit, to be ready for a next execution inside the same statement. More...
 
virtual bool use_protocol_adapter () const
 
virtual bool use_protocol_wrapper () const
 
virtual void set_limit (ha_rows)
 Only overridden (and non-empty) for Query_result_union, q.v. More...
 
virtual Server_side_cursorcursor () 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 ... SELECT in case of error. More...
 

Private Attributes

Table_refcreate_table
 Handle for table to be created. More...
 
HA_CREATE_INFOcreate_info {nullptr}
 Contains further information for table creation. More...
 
Alter_infoalter_info {nullptr}
 Contains further information for table creation. More...
 
Field ** field
 
Table_refselect_tables
 List of tables that are select from. More...
 
Field ** table_fields {nullptr}
 Pointer to first field in table generated from query expression. More...
 
MYSQL_LOCKm_lock {nullptr}
 lock data for tmp table More...
 
MYSQL_LOCK ** m_plock {nullptr}
 m_lock or thd->extra_lock More...
 
handlertonm_post_ddl_ht {nullptr}
 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_reftable_list
 The table used for insertion of rows. More...
 
TABLEtable {nullptr}
 
ulonglong autoinc_value_of_last_inserted_row {0}
 
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 {false}
 ha_start_bulk_insert has been called. Never cleared. More...
 
- Protected Attributes inherited from Query_result
Query_expressionunit
 

Detailed Description

Constructor & Destructor Documentation

◆ Query_result_create()

Query_result_create::Query_result_create ( Table_ref create_table_arg,
mem_root_deque< Item * > *  fields,
enum_duplicates  duplic,
Table_ref 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

◆ create_table_for_query_block()

bool Query_result_create::create_table_for_query_block ( THD thd)
overridevirtual

Create new table.

Parameters
thdthread handler
Returns
false on success, true on error

Reimplemented from Query_result.

◆ 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 ,
const mem_root_deque< Item * > &  ,
Query_expression u 
)
overridevirtual

Perform preparation specific to the query expression or DML statement.

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.

◆ set_two_fields()

void Query_result_create::set_two_fields ( HA_CREATE_INFO create_info_arg,
Alter_info alter_info_arg 
)
inline

◆ start_execution()

bool Query_result_create::start_execution ( THD thd)
overridevirtual

Lock the newly created table and prepare it for insertion.

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,
const mem_root_deque< Item * > &  values 
)
overridevirtual

Reimplemented from Query_result_insert.

Member Data Documentation

◆ alter_info

Alter_info* Query_result_create::alter_info {nullptr}
private

Contains further information for table creation.

◆ create_info

HA_CREATE_INFO* Query_result_create::create_info {nullptr}
private

Contains further information for table creation.

◆ create_table

Table_ref* Query_result_create::create_table
private

Handle for table to be created.

◆ field

Field** Query_result_create::field
private

◆ m_lock

MYSQL_LOCK* Query_result_create::m_lock {nullptr}
private

lock data for tmp table

◆ m_plock

MYSQL_LOCK** Query_result_create::m_plock {nullptr}
private

m_lock or thd->extra_lock

◆ m_post_ddl_ht

handlerton* Query_result_create::m_post_ddl_ht {nullptr}
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_ref* Query_result_create::select_tables
private

List of tables that are select from.

◆ table_fields

Field** Query_result_create::table_fields {nullptr}
private

Pointer to first field in table generated from query expression.


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