MySQL 8.4.3
Source Code Documentation
mysqlimport.cc File Reference
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <time.h>
#include "client/include/client_priv.h"
#include "compression.h"
#include "m_string.h"
#include "my_alloc.h"
#include "my_dbug.h"
#include "my_default.h"
#include "my_inttypes.h"
#include "my_io.h"
#include "my_macros.h"
#include "my_systime.h"
#include "mysql/service_mysql_alloc.h"
#include "mysql/strings/int2str.h"
#include "mysql_version.h"
#include "nulls.h"
#include "print_version.h"
#include "strxmov.h"
#include "thr_cond.h"
#include "thr_mutex.h"
#include "typelib.h"
#include "welcome_copyright_notice.h"
#include "client/include/caching_sha2_passwordopt-vars.h"
#include "client/include/multi_factor_passwordopt-vars.h"
#include "client/include/sslopt-vars.h"
#include "client/include/multi_factor_passwordopt-longopts.h"
#include "client/include/caching_sha2_passwordopt-longopts.h"
#include "client/include/sslopt-longopts.h"
#include "client/include/sslopt-case.h"

Functions

static int db_error_with_table (MYSQL *mysql, char *table)
 
static int db_error (MYSQL *mysql)
 
static char * field_escape (char *to, const char *from, uint length)
 
static char * add_load_option (char *ptr, const char *object, const char *statement)
 
static void usage (void)
 
static bool get_one_option (int optid, const struct my_option *opt, char *argument)
 
static int get_options (int *argc, char ***argv)
 
static int write_to_table (char *filename, MYSQL *mysql)
 
static int lock_table (MYSQL *mysql, int tablecount, char **raw_tablename)
 
static MYSQLdb_connect (char *host, char *database, char *user, char *)
 
static void db_disconnect (char *host, MYSQL *mysql)
 
static int safe_exit (int error)
 
static void * worker_thread (void *arg)
 
int main (int argc, char **argv)
 

Variables

uint counter
 
native_mutex_t init_mutex
 
native_mutex_t counter_mutex
 
native_cond_t count_threshold
 
static bool verbose = false
 
static bool lock_tables = false
 
static bool ignore_errors = false
 
static bool opt_delete = false
 
static bool replace = false
 
static bool silent = false
 
static bool ignore = false
 
static bool opt_compress = false
 
static bool opt_low_priority = false
 
static bool debug_info_flag = false
 
static bool debug_check_flag = false
 
static uint opt_use_threads = 0
 
static uint opt_local_file = 0
 
static uint my_end_arg = 0
 
static char * current_user = nullptr
 
static char * current_host = nullptr
 
static char * current_db = nullptr
 
static char * fields_terminated = nullptr
 
static char * lines_terminated = nullptr
 
static char * enclosed = nullptr
 
static char * opt_enclosed = nullptr
 
static char * escaped = nullptr
 
static char * opt_columns = nullptr
 
static const char * default_charset = MYSQL_AUTODETECT_CHARSET_NAME
 
static uint opt_enable_cleartext_plugin = 0
 
static bool using_opt_enable_cleartext_plugin = false
 
static uint opt_mysql_port = 0
 
static uint opt_protocol = 0
 
static char * opt_bind_addr = nullptr
 
static char * opt_mysql_unix_port = nullptr
 
static char * opt_plugin_dir = nullptr
 
static char * opt_default_auth = nullptr
 
static longlong opt_ignore_lines = -1
 
static uint opt_zstd_compress_level = default_zstd_compression_level
 
static char * opt_compress_algorithm = nullptr
 
static struct my_option my_long_options []
 
static const char * load_default_groups [] = {"mysqlimport", "client", nullptr}
 
int exitcode = 0
 

Function Documentation

◆ add_load_option()

static char * add_load_option ( char *  ptr,
const char *  object,
const char *  statement 
)
static

◆ db_connect()

static MYSQL * db_connect ( char *  host,
char *  database,
char *  user,
char *   
)
static

◆ db_disconnect()

static void db_disconnect ( char *  host,
MYSQL mysql 
)
static

◆ db_error()

static int db_error ( MYSQL mysql)
static

◆ db_error_with_table()

static int db_error_with_table ( MYSQL mysql,
char *  table 
)
static

◆ field_escape()

static char * field_escape ( char *  to,
const char *  from,
uint  length 
)
static

◆ get_one_option()

static bool get_one_option ( int  optid,
const struct my_option opt,
char *  argument 
)
static

◆ get_options()

static int get_options ( int *  argc,
char ***  argv 
)
static

◆ lock_table()

static int lock_table ( MYSQL mysql,
int  tablecount,
char **  raw_tablename 
)
static

◆ main()

int main ( int  argc,
char **  argv 
)

◆ safe_exit()

static int safe_exit ( int  error)
static

◆ usage()

static void usage ( void  )
static

◆ worker_thread()

static void * worker_thread ( void *  arg)
static

◆ write_to_table()

static int write_to_table ( char *  filename,
MYSQL mysql 
)
static

Variable Documentation

◆ count_threshold

native_cond_t count_threshold

◆ counter

uint counter

◆ counter_mutex

native_mutex_t counter_mutex

◆ current_db

char * current_db = nullptr
static

◆ current_host

char * current_host = nullptr
static

◆ current_user

char* current_user = nullptr
static

◆ debug_check_flag

bool debug_check_flag = false
static

◆ debug_info_flag

bool debug_info_flag = false
static

◆ default_charset

const char* default_charset = MYSQL_AUTODETECT_CHARSET_NAME
static

◆ enclosed

char * enclosed = nullptr
static

◆ escaped

char * escaped = nullptr
static

◆ exitcode

int exitcode = 0

◆ fields_terminated

char * fields_terminated = nullptr
static

◆ ignore

bool ignore = false
static

◆ ignore_errors

bool ignore_errors = false
static

◆ init_mutex

native_mutex_t init_mutex

◆ lines_terminated

char * lines_terminated = nullptr
static

◆ load_default_groups

const char* load_default_groups[] = {"mysqlimport", "client", nullptr}
static

◆ lock_tables

bool lock_tables = false
static

◆ my_end_arg

uint my_end_arg = 0
static

◆ my_long_options

struct my_option my_long_options[]
static

◆ opt_bind_addr

char* opt_bind_addr = nullptr
static

◆ opt_columns

char * opt_columns = nullptr
static

◆ opt_compress

bool opt_compress = false
static

◆ opt_compress_algorithm

char* opt_compress_algorithm = nullptr
static

◆ opt_default_auth

char * opt_default_auth = nullptr
static

◆ opt_delete

bool opt_delete = false
static

◆ opt_enable_cleartext_plugin

uint opt_enable_cleartext_plugin = 0
static

◆ opt_enclosed

char * opt_enclosed = nullptr
static

◆ opt_ignore_lines

longlong opt_ignore_lines = -1
static

◆ opt_local_file

uint opt_local_file = 0
static

◆ opt_low_priority

bool opt_low_priority = false
static

◆ opt_mysql_port

uint opt_mysql_port = 0
static

◆ opt_mysql_unix_port

char* opt_mysql_unix_port = nullptr
static

◆ opt_plugin_dir

char* opt_plugin_dir = nullptr
static

◆ opt_protocol

uint opt_protocol = 0
static

◆ opt_use_threads

uint opt_use_threads = 0
static

◆ opt_zstd_compress_level

uint opt_zstd_compress_level = default_zstd_compression_level
static

◆ replace

bool replace = false
static

◆ silent

bool silent = false
static

◆ using_opt_enable_cleartext_plugin

bool using_opt_enable_cleartext_plugin = false
static

◆ verbose

bool verbose = false
static