24#ifndef SQL_INSERT_INCLUDED
25#define SQL_INSERT_INCLUDED
136 fields(target_or_source_columns),
139 (target_columns ==
nullptr || !target_columns->
empty()), duplic),
142 assert(target_or_source_columns !=
nullptr);
143 assert(target_columns == target_or_source_columns ||
144 target_columns ==
nullptr);
Data describing the table being created by CREATE TABLE or altered by ALTER TABLE.
Definition: sql_alter.h:204
This class encapsulates a data change operation.
Definition: sql_data_change.h:74
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:853
This class represents a query expression (one query block or several query blocks combined with UNION...
Definition: sql_lex.h:623
Definition: sql_insert.h:171
Field ** field
Definition: sql_insert.h:178
HA_CREATE_INFO * create_info
Contains further information for table creation.
Definition: sql_insert.h:175
Table_ref * select_tables
List of tables that are select from.
Definition: sql_insert.h:180
Table_ref * create_table
Handle for table to be created.
Definition: sql_insert.h:173
Field ** table_fields
Pointer to first field in table generated from query expression.
Definition: sql_insert.h:182
handlerton * m_post_ddl_ht
If table being created has SE supporting atomic DDL, pointer to SE's handlerton object to be used for...
Definition: sql_insert.h:192
void abort_result_set(THD *thd) override
Definition: sql_insert.cc:3260
Alter_info * alter_info
Contains further information for table creation.
Definition: sql_insert.h:177
int binlog_show_create_table(THD *thd)
Definition: sql_insert.cc:2970
bool start_execution(THD *thd) override
Lock the newly created table and prepare it for insertion.
Definition: sql_insert.cc:2877
bool stmt_binlog_is_trans() const override
Indicates whether this statement should be written to binary log's transactional cache in statement m...
Definition: sql_insert.cc:3066
bool send_eof(THD *thd) override
Definition: sql_insert.cc:3074
void store_values(THD *thd, const mem_root_deque< Item * > &values) override
Definition: sql_insert.cc:3047
Query_result_create(Table_ref *create_table_arg, mem_root_deque< Item * > *fields, enum_duplicates duplic, Table_ref *select_tables_arg)
Definition: sql_insert.cc:2804
bool prepare(THD *thd, const mem_root_deque< Item * > &list, Query_expression *u) override
Perform preparation specific to the query expression or DML statement.
Definition: sql_insert.cc:2817
MYSQL_LOCK * m_lock
lock data for tmp table
Definition: sql_insert.h:184
void set_two_fields(HA_CREATE_INFO *create_info_arg, Alter_info *alter_info_arg)
Definition: sql_insert.h:206
MYSQL_LOCK ** m_plock
m_lock or thd->extra_lock
Definition: sql_insert.h:186
void drop_open_table(THD *thd)
Close and drop just created table in CREATE TABLE ... SELECT in case of error.
Definition: sql_insert.cc:3200
bool create_table_for_query_block(THD *thd) override
Create new table.
Definition: sql_insert.cc:2833
Definition: sql_insert.h:59
virtual void store_values(THD *thd, const mem_root_deque< Item * > &values)
Definition: sql_insert.cc:2416
COPY_INFO update
the UPDATE part of "info"
Definition: sql_insert.h:80
mem_root_deque< Item * > * fields
The columns of the table to be inserted into, or the columns of the table from which values are selec...
Definition: sql_insert.h:71
bool start_execution(THD *thd) override
Set up the target table for execution.
Definition: sql_insert.cc:2283
bool prepare(THD *thd, const mem_root_deque< Item * > &list, Query_expression *u) override
Perform preparation specific to the query expression or DML statement.
Definition: sql_insert.cc:2254
bool send_data(THD *thd, const mem_root_deque< Item * > &items) override
Definition: sql_insert.cc:2342
virtual bool stmt_binlog_is_trans() const
Indicates whether this statement should be written to binary log's transactional cache in statement m...
Definition: sql_insert.cc:2431
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)
Definition: sql_insert.h:128
bool send_eof(THD *thd) override
Definition: sql_insert.cc:2435
void abort_result_set(THD *thd) override
Definition: sql_insert.cc:2537
ulonglong autoinc_value_of_last_inserted_row
Definition: sql_insert.h:78
TABLE * table
Definition: sql_insert.h:63
void cleanup() override
Cleanup after this execution.
Definition: sql_insert.cc:2326
bool need_explain_interceptor() const override
Definition: sql_insert.h:148
bool insert_into_view
Definition: sql_insert.h:81
COPY_INFO info
Definition: sql_insert.h:79
bool bulk_insert_started
ha_start_bulk_insert has been called. Never cleared.
Definition: sql_insert.h:75
Table_ref * table_list
The table used for insertion of rows.
Definition: sql_insert.h:62
Definition: query_result.h:174
Abstract base class for traversing the Query_block tree.
Definition: select_lex_visitor.h:40
Definition: sql_cmd_dml.h:35
Base class for all INSERT and REPLACE statements.
Definition: sql_insert.h:223
mem_root_deque< Item * > values_field_list
Field list for VALUES derived table.
Definition: sql_insert.h:291
bool resolve_values_table_columns(THD *thd)
Resolve the columns of the optional VALUES table to the insert_values of the table inserted into.
Definition: sql_insert.cc:1631
bool prepare_values_table(THD *thd)
Prepare the derived table created as a VALUES alias.
Definition: sql_insert.cc:1559
Sql_cmd_insert_base(bool is_replace_arg, enum_duplicates duplicates_arg)
Definition: sql_insert.h:295
mem_root_deque< Item * > update_field_list
ON DUPLICATE KEY UPDATE field list.
Definition: sql_insert.h:275
Create_col_name_list * values_column_list
Definition: sql_insert.h:284
bool restore_cmd_properties(THD *thd) override
Restore command properties before execution.
Definition: sql_insert.cc:1722
mem_root_deque< List_item * > insert_many_values
Row data to insert/replace.
Definition: sql_insert.h:263
bool resolve_update_expressions(THD *thd)
Resolve ON DUPLICATE KEY UPDATE expressions.
Definition: sql_insert.cc:1670
bool precheck(THD *thd) override
Perform a precheck of table privileges for the specific operation.
Definition: sql_insert.cc:428
bool prepare_inner(THD *thd) override
Prepare items in INSERT statement.
Definition: sql_insert.cc:994
Table_ref * values_table
ON DUPLICATE KEY UPDATE reference to VALUES.
Definition: sql_insert.h:283
uint column_count
Number of columns in original insert column list.
Definition: sql_insert.h:269
bool get_default_columns(THD *thd, TABLE *table, MY_BITMAP **m_function_default_columns)
Definition: sql_insert.cc:939
const bool is_replace
true when REPLACE statement, false when INSERT statement
Definition: sql_insert.h:239
uint value_count
Number of values per row in insert_many_values, available after resolving.
Definition: sql_insert.h:272
const enum_duplicates duplicates
Definition: sql_insert.h:293
mem_root_deque< Item * > insert_field_list
Field list to insert/replace.
Definition: sql_insert.h:251
mem_root_deque< Item * > update_value_list
ON DUPLICATE KEY UPDATE data value list.
Definition: sql_insert.h:278
bool check_privileges(THD *thd) override
Check privileges on a prepared statement, called at start of execution of the statement.
Definition: sql_insert.cc:442
bool accept(THD *thd, Select_lex_visitor *visitor) override
Definition: sql_insert.cc:3310
bool values_need_privilege_check
True if VALUES clause contain column references that need privilege check.
Definition: sql_insert.h:266
Class that implements INSERT ... SELECT and REPLACE ... SELECT statements.
Definition: sql_insert.h:334
const MYSQL_LEX_CSTRING * eligible_secondary_storage_engine() const override
Is this statement of a type and on a form that makes it eligible for execution in a secondary storage...
Definition: sql_insert.cc:3342
Sql_cmd_insert_select(bool is_replace_arg, enum_duplicates duplicates_arg)
Definition: sql_insert.h:336
enum_sql_command sql_command_code() const override
Return the command code for this statement.
Definition: sql_insert.h:340
Class that implements INSERT ... VALUES and REPLACE ... VALUES statements.
Definition: sql_insert.h:314
bool execute_inner(THD *thd) override
Insert one or more rows from a VALUES list into a table.
Definition: sql_insert.cc:477
enum_sql_command sql_command_code() const override
Return the command code for this statement.
Definition: sql_insert.h:320
Sql_cmd_insert_values(bool is_replace_arg, enum_duplicates duplicates_arg)
Definition: sql_insert.h:316
bool is_single_table_plan() const override
Definition: sql_insert.h:324
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:34
A (partial) implementation of std::deque allocating its blocks on a MEM_ROOT.
Definition: mem_root_deque.h:110
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:222
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
enum_sql_command
Definition: my_sqlcommand.h:46
@ SQLCOM_INSERT
Definition: my_sqlcommand.h:52
@ SQLCOM_INSERT_SELECT
Definition: my_sqlcommand.h:53
@ SQLCOM_REPLACE
Definition: my_sqlcommand.h:87
@ SQLCOM_REPLACE_SELECT
Definition: my_sqlcommand.h:88
static uint update
Definition: myisamlog.cc:91
thread_local MEM_ROOT ** THR_MALLOC
Definition: mysqld.cc:1560
bool empty(const Histogram &histogram)
Return true if 'histogram' was built on an empty table.
Definition: histogram.h:672
std::list< T, ut::allocator< T > > list
Specialization of list which uses ut_allocator.
Definition: ut0new.h:2878
Contains classes representing SQL-data change statements.
enum_duplicates
Definition: sql_data_change.h:48
bool validate_default_values_of_unset_fields(THD *thd, TABLE *table)
Validates default value of fields which are not specified in the column list of INSERT statement.
Definition: sql_insert.cc:308
bool check_that_all_fields_are_given_values(THD *thd, TABLE *entry, Table_ref *table_list)
Check that all fields with aren't null_fields are used.
Definition: sql_insert.cc:2217
void prepare_triggers_for_insert_stmt(THD *thd, TABLE *table)
Prepare triggers for INSERT-like statement.
Definition: sql_insert.cc:334
bool write_record(THD *thd, TABLE *table, COPY_INFO *info, COPY_INFO *update)
Write a record to table with optional deletion of conflicting records, invoke proper triggers if need...
Definition: sql_insert.cc:1791
Struct to hold information about the table that should be created.
Definition: handler.h:3045
Definition: mysql_lex_string.h:40
TABLE ** table
Definition: lock.h:40
Definition: my_bitmap.h:43
Definition: completion_hash.h:35
handlerton is a singleton structure - one instance per storage engine - to provide access to storage ...
Definition: handler.h:2622
unsigned int uint
Definition: uca9-dump.cc:75
static int is_view(cargo_type x)
Definition: xcom_base.cc:2156