diff options
Diffstat (limited to 'client/mysqldump.c')
-rw-r--r-- | client/mysqldump.c | 72 |
1 files changed, 12 insertions, 60 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c index 9c973b9b8cb..50ace857b9e 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -194,12 +194,10 @@ FILE *stderror_file=0; static uint opt_protocol= 0; static char *opt_plugin_dir= 0, *opt_default_auth= 0; -static uint protocol_to_force= MYSQL_PROTOCOL_DEFAULT; - /* -Dynamic_string wrapper functions. In this file use these -wrappers, they will terminate the process if there is -an allocation failure. + Dynamic_string wrapper functions. In this file use these + wrappers, they will terminate the process if there is + an allocation failure. */ static void init_dynamic_string_checked(DYNAMIC_STRING *str, const char *init_str, size_t init_alloc, size_t alloc_increment); @@ -871,9 +869,6 @@ get_one_option(const struct my_option *opt, const char *filename) { - /* Track when protocol is set via CLI to not force overrides */ - static my_bool ignore_protocol_override = FALSE; - switch (opt->id) { case 'p': if (argument == disabled_my_option) @@ -904,13 +899,6 @@ get_one_option(const struct my_option *opt, case 'W': #ifdef _WIN32 opt_protocol= MYSQL_PROTOCOL_PIPE; - - /* Prioritize pipe if explicit via command line */ - if (filename[0] == '\0') - { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } #endif break; case 'N': @@ -1061,49 +1049,23 @@ get_one_option(const struct my_option *opt, sf_leaking_memory= 1; /* no memory leak reports here */ exit(1); } - - /* Specification of protocol via CLI trumps implicit overrides */ - if (filename[0] == '\0') - { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - break; case (int) OPT_DEFAULT_CHARSET: if (default_charset == disabled_my_option) default_charset= (char *)mysql_universal_client_charset; break; case 'P': - /* If port and socket are set, fall back to default behavior */ - if (protocol_to_force == SOCKET_PROTOCOL_TO_FORCE) - { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - - /* If port is set via CLI, try to force protocol to TCP */ - if (filename[0] == '\0' && - !ignore_protocol_override && - protocol_to_force == MYSQL_PROTOCOL_DEFAULT) + if (filename[0] == '\0') { - protocol_to_force = MYSQL_PROTOCOL_TCP; + /* Port given on command line, switch protocol to use TCP */ + opt_protocol= MYSQL_PROTOCOL_TCP; } break; case 'S': - /* If port and socket are set, fall back to default behavior */ - if (protocol_to_force == MYSQL_PROTOCOL_TCP) - { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - - /* Prioritize socket if set via command line */ - if (filename[0] == '\0' && - !ignore_protocol_override && - protocol_to_force == MYSQL_PROTOCOL_DEFAULT) + if (filename[0] == '\0') { - protocol_to_force = SOCKET_PROTOCOL_TO_FORCE; + /* Socket given on command line, switch protocol to use SOCKETSt */ + opt_protocol= MYSQL_PROTOCOL_SOCKET; } break; } @@ -1152,19 +1114,9 @@ static int get_options(int *argc, char ***argv) return(ho_error); /* - Command line options override configured protocol - */ - if (protocol_to_force > MYSQL_PROTOCOL_DEFAULT - && protocol_to_force != opt_protocol) - { - warn_protocol_override(current_host, &opt_protocol, protocol_to_force); - } - - - /* - Dumping under --system=stats with --replace or --insert-ignore is safe and will not - result into race condition. Otherwise dump only structure and ignore data by default - while dumping. + Dumping under --system=stats with --replace or --insert-ignore is + safe and will not result into race condition. Otherwise dump only + structure and ignore data by default while dumping. */ if (!(opt_system & OPT_SYSTEM_STATS) && !(opt_ignore || opt_replace_into)) { |