mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge remote-tracking branch 'github/bb-11.4-release' into bb-11.8-serg
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "strfunc.h"
|
||||
#include "sql_repl.h"
|
||||
#include "sql_acl.h"
|
||||
#include <sql_common.h>
|
||||
|
||||
#ifdef HAVE_REPLICATION
|
||||
|
||||
@@ -1378,19 +1379,16 @@ Master_info_index::get_master_info(const LEX_CSTRING *connection_name,
|
||||
("connection_name: '%.*s'", (int) connection_name->length,
|
||||
connection_name->str));
|
||||
|
||||
/* Make name lower case for comparison */
|
||||
IdentBufferCasedn<MAX_CONNECTION_NAME> buff(connection_name->str ?
|
||||
*connection_name :
|
||||
empty_clex_str);
|
||||
if (!connection_name->str)
|
||||
connection_name= &empty_clex_str;
|
||||
mi= (Master_info*) my_hash_search(&master_info_hash,
|
||||
(const uchar*) buff.ptr(), buff.length());
|
||||
(uchar*) connection_name->str,
|
||||
connection_name->length);
|
||||
if (!mi && warning != Sql_condition::WARN_LEVEL_NOTE)
|
||||
{
|
||||
my_error(WARN_NO_MASTER_INFO,
|
||||
MYF(warning == Sql_condition::WARN_LEVEL_WARN ? ME_WARNING :
|
||||
0),
|
||||
(int) connection_name->length,
|
||||
connection_name->str);
|
||||
MYF(warning == Sql_condition::WARN_LEVEL_WARN ? ME_WARNING : 0),
|
||||
(int) connection_name->length, connection_name->str);
|
||||
}
|
||||
DBUG_RETURN(mi);
|
||||
}
|
||||
@@ -2104,4 +2102,48 @@ bool Master_info_index::flush_all_relay_logs()
|
||||
DBUG_RETURN(result);
|
||||
}
|
||||
|
||||
void setup_mysql_connection_for_master(MYSQL *mysql, Master_info *mi,
|
||||
uint timeout)
|
||||
{
|
||||
DBUG_ASSERT(mi);
|
||||
DBUG_ASSERT(mi->mysql);
|
||||
mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT, (char *) &timeout);
|
||||
mysql_options(mysql, MYSQL_OPT_READ_TIMEOUT, (char *) &timeout);
|
||||
|
||||
#ifdef HAVE_OPENSSL
|
||||
if (mi->ssl)
|
||||
{
|
||||
mysql_ssl_set(mysql, mi->ssl_key, mi->ssl_cert, mi->ssl_ca, mi->ssl_capath,
|
||||
mi->ssl_cipher);
|
||||
mysql_options(mysql, MYSQL_OPT_SSL_CRL, mi->ssl_crl);
|
||||
mysql_options(mysql, MYSQL_OPT_SSL_CRLPATH, mi->ssl_crlpath);
|
||||
mysql_options(mysql, MYSQL_OPT_SSL_VERIFY_SERVER_CERT,
|
||||
&mi->ssl_verify_server_cert);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
mysql->options.use_ssl= 0;
|
||||
|
||||
/*
|
||||
If server's default charset is not supported (like utf16, utf32) as client
|
||||
charset, then set client charset to 'latin1' (default client charset).
|
||||
*/
|
||||
if (is_supported_parser_charset(default_charset_info))
|
||||
mysql_options(mysql, MYSQL_SET_CHARSET_NAME, default_charset_info->cs_name.str);
|
||||
else
|
||||
{
|
||||
sql_print_information("'%s' can not be used as client character set. "
|
||||
"'%s' will be used as default client character set "
|
||||
"while connecting to master.",
|
||||
default_charset_info->cs_name.str,
|
||||
default_client_charset_info->cs_name.str);
|
||||
mysql_options(mysql, MYSQL_SET_CHARSET_NAME,
|
||||
default_client_charset_info->cs_name.str);
|
||||
}
|
||||
|
||||
/* 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);
|
||||
}
|
||||
|
||||
#endif /* HAVE_REPLICATION */
|
||||
|
Reference in New Issue
Block a user