diff options
author | Jon Olav Hauglid <jon.hauglid@oracle.com> | 2010-10-06 11:29:44 +0200 |
---|---|---|
committer | Jon Olav Hauglid <jon.hauglid@oracle.com> | 2010-10-06 11:29:44 +0200 |
commit | 38194bf7a5d4927f8adeddc5e00bf4feab08114f (patch) | |
tree | b33dfb00e00ec3f4473c088305871021f437ee46 /client/mysql.cc | |
parent | 623ed1946215e25682847ac3b0ea066cab35ea59 (diff) | |
parent | 052c9e392e6d9b770511c88cfec05ef606bff2ed (diff) | |
download | mariadb-git-38194bf7a5d4927f8adeddc5e00bf4feab08114f.tar.gz |
Merge from mysql-5.5-bugteam to mysql-5.5-runtime.
Diffstat (limited to 'client/mysql.cc')
-rw-r--r-- | client/mysql.cc | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/client/mysql.cc b/client/mysql.cc index b61a751198a..14473ba4b51 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -166,6 +166,7 @@ static int wait_time = 5; static STATUS status; static ulong select_limit,max_join_size,opt_connect_timeout=0; static char mysql_charsets_dir[FN_REFLEN+1]; +static char *opt_plugin_dir= 0, *opt_default_auth; static const char *xmlmeta[] = { "&", "&", "<", "<", @@ -1564,6 +1565,13 @@ static struct my_option my_long_options[] = {"show-warnings", OPT_SHOW_WARNINGS, "Show warnings after every statement.", &show_warnings, &show_warnings, 0, GET_BOOL, 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} }; @@ -4295,9 +4303,15 @@ sql_real_connect(char *host,char *database,char *user,char *password, 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 (!mysql_real_connect(&mysql, host, user, password, - database, opt_mysql_port, opt_mysql_unix_port, - connect_flag | CLIENT_MULTI_STATEMENTS)) + database, opt_mysql_port, opt_mysql_unix_port, + connect_flag | CLIENT_MULTI_STATEMENTS)) { if (!silent || (mysql_errno(&mysql) != CR_CONN_HOST_ERROR && |