MySQL  8.0.18
Source Code Documentation
mysqlimport.cc File Reference
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <time.h>
#include "client/client_priv.h"
#include "compression.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_version.h"
#include "print_version.h"
#include "thr_cond.h"
#include "thr_mutex.h"
#include "typelib.h"
#include "welcome_copyright_notice.h"
#include "caching_sha2_passwordopt-vars.h"
#include "sslopt-vars.h"
#include "caching_sha2_passwordopt-longopts.h"
#include "sslopt-longopts.h"
#include "sslopt-case.h"

Functions

static void db_error_with_table (MYSQL *mysql, char *table)
 
static void 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 int get_options (int *argc, char ***argv)
 
static int write_to_table (char *filename, MYSQL *mysql)
 
static void lock_table (MYSQL *mysql, int tablecount, char **raw_tablename)
 
static MYSQLdb_connect (char *host, char *database, char *user, char *passwd)
 
static void db_disconnect (char *host, MYSQL *mysql)
 
static void safe_exit (int error, MYSQL *mysql)
 
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 = 0
 
static bool lock_tables = 0
 
static bool ignore_errors = 0
 
static bool opt_delete = 0
 
static bool replace = 0
 
static bool silent = 0
 
static bool ignore = 0
 
static bool opt_compress = 0
 
static bool opt_low_priority = 0
 
static bool tty_password = 0
 
static bool debug_info_flag = 0
 
static bool debug_check_flag = 0
 
static uint opt_use_threads = 0
 
static uint opt_local_file = 0
 
static uint my_end_arg = 0
 
static char * opt_password = 0
 
static char * current_user = 0
 
static char * current_host = 0
 
static char * current_db = 0
 
static char * fields_terminated = 0
 
static char * lines_terminated = 0
 
static char * enclosed = 0
 
static char * opt_enclosed = 0
 
static char * escaped = 0
 
static char * opt_columns = 0
 
static const char * default_charset = MYSQL_AUTODETECT_CHARSET_NAME
 
static uint opt_enable_cleartext_plugin = 0
 
static bool using_opt_enable_cleartext_plugin = 0
 
static uint opt_mysql_port = 0
 
static uint opt_protocol = 0
 
static char * opt_bind_addr = NULL
 
static char * opt_mysql_unix_port = 0
 
static char * opt_plugin_dir = 0
 
static char * opt_default_auth = 0
 
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", 0}
 
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 *  passwd 
)
static

◆ db_disconnect()

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

◆ db_error()

static void db_error ( MYSQL mysql)
static

◆ db_error_with_table()

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

◆ field_escape()

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

◆ get_options()

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

◆ lock_table()

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

◆ main()

int main ( int  argc,
char **  argv 
)

◆ safe_exit()

static void safe_exit ( int  error,
MYSQL mysql 
)
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 = 0
static

◆ current_host

char * current_host = 0
static

◆ current_user

char * current_user = 0
static

◆ debug_check_flag

bool debug_check_flag = 0
static

◆ debug_info_flag

bool debug_info_flag = 0
static

◆ default_charset

const char* default_charset = MYSQL_AUTODETECT_CHARSET_NAME
static

◆ enclosed

char * enclosed = 0
static

◆ escaped

char * escaped = 0
static

◆ exitcode

int exitcode = 0

◆ fields_terminated

char * fields_terminated = 0
static

◆ ignore

bool ignore = 0
static

◆ ignore_errors

bool ignore_errors = 0
static

◆ init_mutex

native_mutex_t init_mutex

◆ lines_terminated

char * lines_terminated = 0
static

◆ load_default_groups

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

◆ lock_tables

bool lock_tables = 0
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 = NULL
static

◆ opt_columns

char * opt_columns = 0
static

◆ opt_compress

bool opt_compress = 0
static

◆ opt_compress_algorithm

char* opt_compress_algorithm = nullptr
static

◆ opt_default_auth

char * opt_default_auth = 0
static

◆ opt_delete

bool opt_delete = 0
static

◆ opt_enable_cleartext_plugin

uint opt_enable_cleartext_plugin = 0
static

◆ opt_enclosed

char * opt_enclosed = 0
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 = 0
static

◆ opt_mysql_port

uint opt_mysql_port = 0
static

◆ opt_mysql_unix_port

char* opt_mysql_unix_port = 0
static

◆ opt_password

char* opt_password = 0
static

◆ opt_plugin_dir

char* opt_plugin_dir = 0
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 = 0
static

◆ silent

bool silent = 0
static

◆ tty_password

bool tty_password = 0
static

◆ using_opt_enable_cleartext_plugin

bool using_opt_enable_cleartext_plugin = 0
static

◆ verbose

bool verbose = 0
static