summaryrefslogtreecommitdiff
path: root/client/mysqldump.c
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay.choubey@sun.com>2010-12-07 17:37:07 +0530
committerNirbhay Choubey <nirbhay.choubey@sun.com>2010-12-07 17:37:07 +0530
commite3922b8b91788a410fe8f436838c6f3aedc962f6 (patch)
treea5d0bff597e4823118b42ddd857c4944843450ed /client/mysqldump.c
parent5046dc160b5112d065a3b513dd90f4c1d5510807 (diff)
downloadmariadb-git-e3922b8b91788a410fe8f436838c6f3aedc962f6.tar.gz
Bug#58139 : default-auth option not recognized in MySQL standard
command line clients. Command line tools like mysqladmin and mysqldump did not recognize default-auth and plugin-dir options. Support for these options was found missing in these command line tools. Fixed by adding support for the same. client/mysqladmin.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/mysqldump.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. mysql-test/t/plugin_auth.test: Added test case for Bug#58139.
Diffstat (limited to 'client/mysqldump.c')
-rw-r--r--client/mysqldump.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/client/mysqldump.c b/client/mysqldump.c
index b47d88290a5..2d38e94f0fb 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -137,6 +137,7 @@ FILE *stderror_file=0;
static char *shared_memory_base_name=0;
#endif
static uint opt_protocol= 0;
+static char *opt_plugin_dir= 0, *opt_default_auth;
/*
Dynamic_string wrapper functions. In this file use these
@@ -499,6 +500,13 @@ static struct my_option my_long_options[] =
&where, &where, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"xml", 'X', "Dump a database as well formed XML.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"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},
+ {"default_auth", OPT_PLUGIN_DIR,
+ "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},
{0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -1452,6 +1460,13 @@ static int connect_to_db(char *host, char *user,char *passwd)
mysql_options(&mysql_connection,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
mysql_options(&mysql_connection, MYSQL_SET_CHARSET_NAME, default_charset);
+
+ if (opt_plugin_dir && *opt_plugin_dir)
+ mysql_options(&mysql_connection, MYSQL_PLUGIN_DIR, opt_plugin_dir);
+
+ if (opt_default_auth && *opt_default_auth)
+ mysql_options(&mysql_connection, MYSQL_DEFAULT_AUTH, opt_default_auth);
+
if (!(mysql= mysql_real_connect(&mysql_connection,host,user,passwd,
NULL,opt_mysql_port,opt_mysql_unix_port,
0)))