diff options
Diffstat (limited to 'client/mysqlimport.c')
-rw-r--r-- | client/mysqlimport.c | 58 |
1 files changed, 6 insertions, 52 deletions
diff --git a/client/mysqlimport.c b/client/mysqlimport.c index 6307cd0c46e..00daec49499 100644 --- a/client/mysqlimport.c +++ b/client/mysqlimport.c @@ -64,8 +64,6 @@ static char * opt_mysql_unix_port=0; static char *opt_plugin_dir= 0, *opt_default_auth= 0; static longlong opt_ignore_lines= -1; -static uint protocol_to_force= MYSQL_PROTOCOL_DEFAULT; - #include <sslopt-vars.h> static char **argv_to_free; @@ -220,9 +218,6 @@ static my_bool get_one_option(const struct my_option *opt, const char *argument, 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) @@ -249,14 +244,6 @@ get_one_option(const struct my_option *opt, const char *argument, case 'W': opt_protocol = MYSQL_PROTOCOL_PIPE; opt_local_file=1; - - /* Prioritize pipe if explicit via command line */ - if (filename[0] == '\0') - { - ignore_protocol_override = TRUE; - protocol_to_force = MYSQL_PROTOCOL_DEFAULT; - } - break; #endif case OPT_MYSQL_PROTOCOL: @@ -266,45 +253,19 @@ get_one_option(const struct my_option *opt, const char *argument, 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 '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; case '#': @@ -706,13 +667,6 @@ int main(int argc, char **argv) return(1); } - /* 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); - } - sf_leaking_memory=0; /* from now on we cleanup properly */ if (opt_use_threads && !lock_tables) |