summaryrefslogtreecommitdiff
path: root/client/mysqlimport.c
diff options
context:
space:
mode:
Diffstat (limited to 'client/mysqlimport.c')
-rw-r--r--client/mysqlimport.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index 1933ea41bcf..603e9036106 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -193,7 +193,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case '?':
usage();
exit(0);
-#include "sslopt-case.h"
}
return 0;
}
@@ -348,6 +347,9 @@ static MYSQL *db_connect(char *host, char *database, char *user, char *passwd)
mysql_options(&mysql_connection,MYSQL_OPT_LOCAL_INFILE,
(char*) &opt_local_file);
#ifdef HAVE_OPENSSL
+ if (opt_ssl_key || opt_ssl_cert || opt_ssl_ca || opt_ssl_capath ||
+ opt_ssl_cipher)
+ opt_use_ssl= 1;
if (opt_use_ssl)
mysql_ssl_set(&mysql_connection, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath, opt_ssl_cipher);
@@ -469,9 +471,15 @@ int main(int argc, char **argv)
/* argv is changed in the program */
argv_to_free= argv;
if (get_options(&argc, &argv))
+ {
+ free_defaults(argv_to_free);
return(1);
+ }
if (!(sock= db_connect(current_host,current_db,current_user,opt_password)))
+ {
+ free_defaults(argv_to_free);
return(1); /* purecov: deadcode */
+ }
if (lock_tables)
lock_table(sock, argc, argv);
for (; *argv != NULL; argv++)