24#ifndef SQL_LOAD_INCLUDED
25#define SQL_LOAD_INCLUDED
79 if (opt_fields_or_vars)
81 assert((opt_set_fields ==
nullptr) ^ (opt_set_exprs !=
nullptr));
83 assert(opt_set_fields->
size() == opt_set_exprs->
size());
90 if (opt_xml_rows_identified_by !=
nullptr)
167 THD *thd,
const char *db,
const char *
table_name,
bool is_concurrent,
168 enum enum_duplicates duplicates,
bool transactional_table,
int errocode);
This service provides interface for loading data in bulk from CSV files.
This class encapsulates a data change operation.
Definition: sql_data_change.h:74
Helper for the sql_exchange class.
Definition: sql_exchange.h:84
void merge_field_separators(const Field_separators *field_sep)
Definition: sql_exchange.h:97
Base class that is used to represent any kind of expression in a relational query.
Definition: item.h:930
Helper for the sql_exchange class.
Definition: sql_exchange.h:65
void merge_line_separators(const Line_separators *line_sep)
Definition: sql_exchange.h:70
const String * line_term
Definition: sql_exchange.h:67
Definition: sql_list.h:494
Definition: sql_load.cc:134
Definition: sql_load.h:49
sql_exchange m_exchange
Definition: sql_load.h:106
const On_duplicate m_on_duplicate
Definition: sql_load.h:126
bool check_bulk_load_parameters(THD *thd)
Check bulk load parameters for limits.
Definition: sql_load.cc:241
bool is_bulk_load() const override
Definition: sql_load.h:103
mem_root_deque< Item * > m_opt_set_fields
Definition: sql_load.h:130
enum_sql_command sql_command_code() const override
Return the command code for this statement.
Definition: sql_load.h:99
bool read_sep_field(THD *thd, COPY_INFO &info, Table_ref *table_list, READ_INFO &read_info, const String &enclosed, ulong skip_lines)
Read rows in delimiter-separated formats.
Definition: sql_load.cc:1392
bool execute_inner(THD *thd, enum enum_duplicates handle_duplicates)
Execute LOAD DATA query.
Definition: sql_load.cc:656
const bool m_is_local_file
Definition: sql_load.h:107
bool execute_bulk(THD *thd)
Execute BULK LOAD DATA.
Definition: sql_load.cc:359
bool read_fixed_length(THD *thd, COPY_INFO &info, Table_ref *table_list, READ_INFO &read_info, ulong skip_lines)
Read of rows of fixed size + optional garbage + optional newline.
Definition: sql_load.cc:1227
ulong m_concurrency
Number of concurrent loaders to use.
Definition: sql_load.h:120
bool m_ordered_data
true if input data is in order of Primary Key.
Definition: sql_load.h:117
bool truncate_table_for_bulk_load(THD *thd, Table_ref *const table_ref, dd::Table *table_def)
Truncate to create a new table for BULK LOAD.
Definition: sql_load.cc:218
enum_source_type m_bulk_source
Source for bulk data.
Definition: sql_load.h:111
mem_root_deque< Item * > m_opt_set_exprs
Definition: sql_load.h:131
LEX_CSTRING m_compression_algorithm_string
Definition: sql_load.h:173
bool read_xml_field(THD *thd, COPY_INFO &info, Table_ref *table_list, READ_INFO &read_info, ulong skip_lines)
Read rows in xml format.
Definition: sql_load.cc:1611
ulong m_file_count
Number of input files.
Definition: sql_load.h:114
bool bulk_driver_service(THD *thd, const TABLE *table, size_t &affected_rows)
Definition: sql_load.cc:483
List< String > *const m_opt_partitions
Definition: sql_load.h:128
Table_ident *const m_table
Definition: sql_load.h:127
ulonglong m_memory_size
Maximum memory size to be used in bytes.
Definition: sql_load.h:123
Sql_cmd_load_table(enum_filetype filetype, bool is_local_file, enum_source_type source_type, const LEX_STRING &filename, ulong file_count, bool in_key_order, On_duplicate on_duplicate, Table_ident *table, List< String > *opt_partitions, const CHARSET_INFO *opt_charset, LEX_CSTRING compression_algorithm, String *opt_xml_rows_identified_by, const Field_separators *field_separators, const Line_separators *line_separators, ulong skip_lines, mem_root_deque< Item * > *opt_fields_or_vars, mem_root_deque< Item * > *opt_set_fields, mem_root_deque< Item * > *opt_set_exprs, List< String > *opt_set_expr_strings, ulong concurrency, ulonglong memory_size, bool is_bulk_operation)
Definition: sql_load.h:51
mem_root_deque< Item * > m_opt_fields_or_vars
Definition: sql_load.h:129
bool execute(THD *thd) override
Execute this SQL statement.
Definition: sql_load.cc:2589
List< String > *const m_opt_set_expr_strings
A list of strings is maintained to store the SET clause command user strings which are specified in l...
Definition: sql_load.h:139
bool validate_table_for_bulk_load(THD *thd, Table_ref *const table_ref, dd::Table *table_def, handlerton **hton)
Validate table for bulk load operation.
Definition: sql_load.cc:302
bool m_is_bulk_operation
true if BULK LOAD.
Definition: sql_load.h:172
bool write_execute_load_query_log_event(THD *thd, const char *db, const char *table_name, bool is_concurrent, enum enum_duplicates duplicates, bool transactional_table, int errocode)
Definition: sql_load.cc:1156
Representation of an SQL command.
Definition: sql_cmd.h:83
Using this class is fraught with peril, and you need to be very careful when doing so.
Definition: sql_string.h:167
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:36
Definition: sql_lex.h:308
A (partial) implementation of std::deque allocating its blocks on a MEM_ROOT.
Definition: mem_root_deque.h:111
size_t size() const
Definition: mem_root_deque.h:461
Definition: sql_exchange.h:192
Field_separators field
Definition: sql_exchange.h:194
File_information file_info
Definition: sql_exchange.h:197
void assign_default_values()
Definition: query_result.cc:220
unsigned long skip_lines
Definition: sql_exchange.h:201
Line_separators line
Definition: sql_exchange.h:195
A table definition from the master.
Definition: rpl_utility.h:249
A better implementation of the UNIX ctype(3) library.
unsigned long long int ulonglong
Definition: my_inttypes.h:56
enum_sql_command
Definition: my_sqlcommand.h:46
@ SQLCOM_LOAD
Definition: my_sqlcommand.h:77
thread_local MEM_ROOT ** THR_MALLOC
Definition: mysqld.cc:1577
static char * enclosed
Definition: mysqldump.cc:151
uint * concurrency
Definition: mysqlslap.cc:202
std::string str(const mysqlrouter::ConfigGenerator::Options::Endpoint &ep)
Definition: config_generator.cc:1117
static PFS_engine_table_share_proxy table
Definition: pfs.cc:61
const char * table_name
Definition: rules_table_service.cc:56
On_duplicate
Definition: parser_yystype.h:244
const char * filename
Definition: pfs_example_component_population.cc:67
Representation of an SQL command.
Contains classes representing SQL-data change statements.
enum_duplicates
Definition: sql_data_change.h:48
enum_filetype
Definition: sql_exchange.h:34
@ UNDEFINED_DEST
Definition: sql_exchange.h:43
enum_source_type
Definition: sql_exchange.h:32
Our own string classes, used pervasively throughout the executor.
Definition: m_ctype.h:421
Definition: mysql_lex_string.h:40
Definition: mysql_lex_string.h:35
handlerton is a singleton structure - one instance per storage engine - to provide access to storage ...
Definition: handler.h:2779