diff options
author | Rafal Somla <rafal.somla@oracle.com> | 2011-09-14 16:10:18 +0200 |
---|---|---|
committer | Rafal Somla <rafal.somla@oracle.com> | 2011-09-14 16:10:18 +0200 |
commit | 3b17a24effa6ba40ef4c3a8e14f2ffefc1997bdf (patch) | |
tree | aadee2ac972792c03350f5f834e8cee27f2d8c52 /sql/slave.cc | |
parent | 0e034eaad3a1fbbf01811c8dc4230afef7ec399b (diff) | |
download | mariadb-git-3b17a24effa6ba40ef4c3a8e14f2ffefc1997bdf.tar.gz |
Bug#12897501 REPLICATION DOES NOT SUPPORT WINDOWS AUTH PLUG-IN
Connection of slave to master using a replication account which authenticates
with an external plugin was not possible.
Fixed by making sure that the CLIENT_PLUGIN_AUTH capability is set when client connects using mysql_real_connect(). Also, a plugin-dir path used by client library to locate authentication plugins is set based on the analogous server setting. This is done in connect_to_master() function before a call to mysql_real_connect().
Diffstat (limited to 'sql/slave.cc')
-rw-r--r-- | sql/slave.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/slave.cc b/sql/slave.cc index d0b123c5c6f..7a3eee952c3 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -4204,6 +4204,10 @@ static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi, /* This one is not strictly needed but we have it here for completeness */ mysql_options(mysql, MYSQL_SET_CHARSET_DIR, (char *) charsets_dir); + /* Set MYSQL_PLUGIN_DIR in case master asks for an external authentication plugin */ + if (opt_plugin_dir_ptr && *opt_plugin_dir_ptr)
+ mysql_options(mysql, MYSQL_PLUGIN_DIR, opt_plugin_dir_ptr);
+ while (!(slave_was_killed = io_slave_killed(thd,mi)) && (reconnect ? mysql_reconnect(mysql) != 0 : mysql_real_connect(mysql, mi->host, mi->user, mi->password, 0, |