summaryrefslogtreecommitdiff
path: root/client/mysqlslap.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/mysqlslap.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/mysqlslap.c')
-rw-r--r--client/mysqlslap.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index 01d96f1f75e..237fa18c226 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -122,6 +122,7 @@ static char *host= NULL, *opt_password= NULL, *user= NULL,
*pre_system= NULL,
*post_system= NULL,
*opt_mysql_unix_port= NULL;
+static char *opt_plugin_dir= 0, *opt_default_auth= 0;
const char *delimiter= "\n";
@@ -338,6 +339,12 @@ int main(int argc, char **argv)
#endif
mysql_options(&mysql, MYSQL_SET_CHARSET_NAME, default_charset);
+ 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);
+
if (!opt_only_print)
{
if (!(mysql_real_connect(&mysql, host, user, opt_password,
@@ -581,6 +588,10 @@ static struct my_option my_long_options[] =
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"debug-info", 'T', "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},
{"delimiter", 'F',
"Delimiter to use in SQL statements supplied in file or command line.",
&delimiter, &delimiter, 0, GET_STR, REQUIRED_ARG,
@@ -620,6 +631,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.", &opt_mysql_port,
&opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,
0},