summaryrefslogtreecommitdiff
path: root/client/mysqlimport.c
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay.choubey@sun.com>2011-01-16 09:29:05 +0530
committerNirbhay Choubey <nirbhay.choubey@sun.com>2011-01-16 09:29:05 +0530
commit6d45683b38e989dfcf76fabc5d81bf185bff1694 (patch)
tree92e02d0ae2f7be9ccd86f465d02e645d4579ca54 /client/mysqlimport.c
parente664d1c69bf6dda8833bdaed085756ef23de0890 (diff)
downloadmariadb-git-6d45683b38e989dfcf76fabc5d81bf185bff1694.tar.gz
Bug#58139 : default-auth option not recognized in MySQL standard
command line clients. Postfix covering other mysql standard clients like mysql_upgrade, mysqlbinlog, mysqlcheck, mysqlimport, mysqlshow and mysqlslap. client/client_priv.h: Bug#58139 : default-auth option not recognized in MySQL standard command line clients Added an entry for 'default-auth' option. client/mysql.cc: Bug#58139 : default-auth option not recognized in MySQL standard command line clients Updated the id entry for default_auth option. client/mysql_upgrade.c: Bug#58139 : default-auth option not recognized in MySQL standard command line clients. Introduced two new variables to hold values from default-auth and plugin-dir options and further pushed them to client's st_mysql instance. client/mysqladmin.cc: Bug#58139 : default-auth option not recognized in MySQL standard command line clients Updated the id entry for default_auth option. client/mysqlbinlog.cc: Bug#58139 : default-auth option not recognized in MySQL standard command line clients. Introduced two new variables to hold values from default-auth and plugin-dir options and further pushed them to client's st_mysql instance. client/mysqlcheck.c: Bug#58139 : default-auth option not recognized in MySQL standard command line clients. Introduced two new variables to hold values from default-auth and plugin-dir options and further pushed them to client's st_mysql instance. client/mysqldump.c: Bug#58139 : default-auth option not recognized in MySQL standard command line clients Updated the id entry for default_auth option. client/mysqlimport.c: Bug#58139 : default-auth option not recognized in MySQL standard command line clients. Introduced two new variables to hold values from default-auth and plugin-dir options and further pushed them to client's st_mysql instance. client/mysqlshow.c: Bug#58139 : default-auth option not recognized in MySQL standard command line clients. Introduced two new variables to hold values from default-auth and plugin-dir options and further pushed them to client's st_mysql instance. client/mysqlslap.c: Bug#58139 : default-auth option not recognized in MySQL standard command line clients. Introduced two new variables to hold values from default-auth and plugin-dir options and further pushed them to client's st_mysql instance. mysql-test/r/plugin_auth.result: Added test case for Bug#58139 for mysql_upgrade. mysql-test/t/plugin_auth.test: Added test case for Bug#58139 for mysql_upgrade.
Diffstat (limited to 'client/mysqlimport.c')
-rw-r--r--client/mysqlimport.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index aea1cb79e74..7966766c1eb 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -60,6 +60,7 @@ static char *opt_password=0, *current_user=0,
*default_charset= (char*) MYSQL_AUTODETECT_CHARSET_NAME;
static uint opt_mysql_port= 0, opt_protocol= 0;
static char * opt_mysql_unix_port=0;
+static char *opt_plugin_dir= 0, *opt_default_auth= 0;
static longlong opt_ignore_lines= -1;
#include <sslopt-vars.h>
@@ -90,6 +91,10 @@ static struct my_option my_long_options[] =
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
&debug_info_flag, &debug_info_flag,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"default_auth", OPT_DEFAULT_AUTH,
+ "Default authentication client-side plugin to use.",
+ (uchar**) &opt_default_auth, (uchar**) &opt_default_auth, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"delete", 'd', "First delete all rows from table.", &opt_delete,
&opt_delete, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"fields-terminated-by", OPT_FTB,
@@ -139,6 +144,9 @@ static struct my_option my_long_options[] =
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
+ {"plugin_dir", OPT_PLUGIN_DIR, "Directory for client-side plugins.",
+ (uchar**) &opt_plugin_dir, (uchar**) &opt_plugin_dir, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection or 0 for default to, in "
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
#if MYSQL_PORT_DEFAULT == 0
@@ -429,6 +437,13 @@ static MYSQL *db_connect(char *host, char *database,
if (shared_memory_base_name)
mysql_options(mysql,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
+
+ if (opt_plugin_dir && *opt_plugin_dir)
+ mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir);
+
+ if (opt_default_auth && *opt_default_auth)
+ mysql_options(mysql, MYSQL_DEFAULT_AUTH, opt_default_auth);
+
mysql_options(mysql, MYSQL_SET_CHARSET_NAME, default_charset);
if (!(mysql_real_connect(mysql,host,user,passwd,
database,opt_mysql_port,opt_mysql_unix_port,