MySQL 9.1.0
Source Code Documentation
sql_load.cc File Reference
#include "sql/sql_load.h"
#include <fcntl.h>
#include <limits.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <algorithm>
#include <atomic>
#include <limits>
#include <sstream>
#include "my_base.h"
#include "my_bitmap.h"
#include "my_dbug.h"
#include "my_dir.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_macros.h"
#include "my_sys.h"
#include "my_thread_local.h"
#include "mysql/binlog/event/load_data_events.h"
#include "mysql/components/services/log_builtins.h"
#include "mysql/my_loglevel.h"
#include "mysql/psi/mysql_file.h"
#include "mysql/service_mysql_alloc.h"
#include "mysql/strings/m_ctype.h"
#include "mysql/thread_type.h"
#include "mysql_com.h"
#include "mysqld_error.h"
#include "nulls.h"
#include "scope_guard.h"
#include "sql/auth/auth_acls.h"
#include "sql/auth/auth_common.h"
#include "sql/binlog.h"
#include "sql/dd/cache/dictionary_client.h"
#include "sql/dd/dd_table.h"
#include "sql/dd/types/abstract_table.h"
#include "sql/derror.h"
#include "sql/error_handler.h"
#include "sql/field.h"
#include "sql/handler.h"
#include "sql/item.h"
#include "sql/item_func.h"
#include "sql/item_timefunc.h"
#include "sql/log.h"
#include "sql/log_event.h"
#include "sql/mysqld.h"
#include "sql/protocol.h"
#include "sql/protocol_classic.h"
#include "sql/psi_memory_key.h"
#include "sql/query_result.h"
#include "sql/rpl_replica.h"
#include "sql/rpl_rli.h"
#include "sql/sql_base.h"
#include "sql/sql_class.h"
#include "sql/sql_data_change.h"
#include "sql/sql_error.h"
#include "sql/sql_insert.h"
#include "sql/sql_lex.h"
#include "sql/sql_list.h"
#include "sql/sql_show.h"
#include "sql/sql_table.h"
#include "sql/sql_view.h"
#include "sql/system_variables.h"
#include "sql/table.h"
#include "sql/table_trigger_dispatcher.h"
#include "sql/thd_raii.h"
#include "sql/thr_malloc.h"
#include "sql/transaction.h"
#include "sql/transaction_info.h"
#include "sql/trigger_def.h"
#include "sql_string.h"
#include "string_with_len.h"
#include "strxnmov.h"
#include "thr_lock.h"
#include <mysql/components/services/bulk_load_service.h>

Classes

class  XML_TAG
 
class  READ_INFO
 
class  Field_tmp_nullability_guard
 

Namespaces

namespace  anonymous_namespace{sql_load.cc}
 

Macros

#define GET   (stack_pos != stack ? *--stack_pos : my_b_get(&cache))
 
#define PUSH(A)   *(stack_pos++) = (A)
 
#define GET_MBCHARLEN(cs, chr, len)
 The logic here is similar with my_mbcharlen, except for GET and PUSH. More...
 

Functions

bool anonymous_namespace{sql_load.cc}::is_hidden_generated_column (TABLE *table, Item *item)
 Checks if an item is a hidden generated column. More...
 
static int my_xml_entity_to_char (const char *name, size_t length)
 
static int my_tospace (int chr)
 Convert newline, linefeed, tab to space. More...
 

Macro Definition Documentation

◆ GET

#define GET   (stack_pos != stack ? *--stack_pos : my_b_get(&cache))

◆ GET_MBCHARLEN

#define GET_MBCHARLEN (   cs,
  chr,
  len 
)
Value:
do { \
len = my_mbcharlen((cs), (chr)); \
if (len == 0 && my_mbmaxlenlen((cs)) == 2) { \
const int chr1 = GET; \
if (chr1 != my_b_EOF) { \
len = my_mbcharlen_2((cs), (chr), chr1); \
/* Character is gb18030 or invalid (len = 0) */ \
assert(len == 0 || len == 2 || len == 4); \
} \
if (len != 0) PUSH(chr1); \
} \
} while (0)
constexpr int my_b_EOF
Definition: my_sys.h:487
unsigned my_mbcharlen_2(const CHARSET_INFO *cs, uint8_t first_byte, uint8_t second_byte)
Get the length of gb18030 code by the given two leading bytes.
Definition: m_ctype.h:696
unsigned my_mbcharlen(const CHARSET_INFO *cs, unsigned first_byte)
Definition: m_ctype.h:682
unsigned my_mbmaxlenlen(const CHARSET_INFO *cs)
Get the maximum length of leading bytes needed to determine the length of a multi-byte gb18030 code.
Definition: m_ctype.h:710
Definition: commit_order_queue.h:34
#define GET
Definition: sql_load.cc:130
#define PUSH(A)
Definition: sql_load.cc:131

The logic here is similar with my_mbcharlen, except for GET and PUSH.

Parameters
[in]cscharset info
[in]chrthe first char of sequence
[out]lenthe length of multi-byte char

◆ PUSH

#define PUSH (   A)    *(stack_pos++) = (A)

Function Documentation

◆ my_tospace()

static int my_tospace ( int  chr)
static

Convert newline, linefeed, tab to space.

Parameters
chrcharacter

According to the "XML 1.0" standard, only space (#x20) characters, carriage returns, line feeds or tabs are considered as spaces. Convert all of them to space (#x20) for parsing simplicity.

◆ my_xml_entity_to_char()

static int my_xml_entity_to_char ( const char *  name,
size_t  length 
)
static