diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-05-16 14:24:29 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-05-16 14:24:29 +0300 |
commit | 3d56adbfac394b2b3ffd22a89fe7c2978ed9a505 (patch) | |
tree | 20d568348fb9aab84446988823f1a971f45a7aca /client | |
parent | b7d22a843e36cd5b8695f8ac2b92789d1cf50e4f (diff) | |
parent | 796486d19b7eede58566620dfd110d24ac723218 (diff) | |
download | mariadb-git-3d56adbfac394b2b3ffd22a89fe7c2978ed9a505.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'client')
-rw-r--r-- | client/mysqlimport.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/client/mysqlimport.c b/client/mysqlimport.c index 8740670c1c4..dbb2e8f7dba 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -48,8 +48,8 @@ static char *add_load_option(char *ptr,const char *object, const char *statement); static my_bool verbose=0,lock_tables=0,ignore_errors=0,opt_delete=0, - replace=0,silent=0,ignore=0,opt_compress=0, - opt_low_priority= 0, tty_password= 0; + replace, silent, ignore, ignore_foreign_keys, + opt_compress, opt_low_priority, tty_password; static my_bool debug_info_flag= 0, debug_check_flag= 0; static uint opt_use_threads=0, opt_local_file=0, my_end_arg= 0; static char *opt_password=0, *current_user=0, @@ -123,6 +123,10 @@ static struct my_option my_long_options[] = ¤t_host, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"ignore", 'i', "If duplicate unique key was found, keep old row.", &ignore, &ignore, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, + {"ignore-foreign-keys", 'k', + "Disable foreign key checks while importing the data.", + &ignore_foreign_keys, &ignore_foreign_keys, 0, GET_BOOL, NO_ARG, + 0, 0, 0, 0, 0, 0}, {"ignore-lines", OPT_IGN_LINES, "Ignore first n lines of data infile.", &opt_ignore_lines, &opt_ignore_lines, 0, GET_LL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, @@ -489,6 +493,9 @@ static MYSQL *db_connect(char *host, char *database, ignore_errors=0; db_error(mysql); } + if (ignore_foreign_keys) + mysql_query(mysql, "set foreign_key_checks= 0;"); + return mysql; } |