summaryrefslogtreecommitdiff
path: root/sql/rpl_mi.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/rpl_mi.cc')
-rw-r--r--sql/rpl_mi.cc28
1 files changed, 14 insertions, 14 deletions
diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc
index 12bdf722bec..fced238e334 100644
--- a/sql/rpl_mi.cc
+++ b/sql/rpl_mi.cc
@@ -186,7 +186,7 @@ void init_master_log_pos(Master_info* mi)
if CHANGE MASTER did not specify it. (no data loss in conversion
as hb period has a max)
*/
- mi->heartbeat_period= (float) min(SLAVE_MAX_HEARTBEAT_PERIOD,
+ mi->heartbeat_period= (float) MY_MIN(SLAVE_MAX_HEARTBEAT_PERIOD,
(slave_net_timeout/2.0));
DBUG_ASSERT(mi->heartbeat_period > (float) 0.001
|| mi->heartbeat_period == 0);
@@ -766,20 +766,20 @@ void create_logfile_name_with_suffix(char *res_file_name, size_t length,
{
const char *info_file_end= info_file + (p - res_file_name);
const char *ext= append ? info_file_end : fn_ext2(info_file);
- size_t res_length, ext_pos;
+ size_t res_length, ext_pos, from_length;
uint errors;
/* Create null terminated string */
- strmake(buff, suffix->str, suffix->length);
+ from_length= strmake(buff, suffix->str, suffix->length) - buff;
/* Convert to characters usable in a file name */
- res_length= strconvert(system_charset_info, buff,
+ res_length= strconvert(system_charset_info, buff, from_length,
&my_charset_filename, res, sizeof(res), &errors);
ext_pos= (size_t) (ext - info_file);
length-= (suffix->length - ext_pos); /* Leave place for extension */
p= res_file_name + ext_pos;
*p++= '-'; /* Add separator */
- p= strmake(p, res, min((size_t) (length - (p - res_file_name)),
+ p= strmake(p, res, MY_MIN((size_t) (length - (p - res_file_name)),
res_length));
/* Add back extension. We have checked above that there is space for it */
strmov(p, ext);
@@ -957,7 +957,7 @@ bool Master_info_index::init_all_master_info()
sql_print_error("Initialized Master_info from '%s' failed",
buf_master_info_file);
if (!master_info_index->get_master_info(&connection_name,
- MYSQL_ERROR::WARN_LEVEL_NOTE))
+ Sql_condition::WARN_LEVEL_NOTE))
{
/* Master_info is not in HASH; Add it */
if (master_info_index->add_master_info(mi, FALSE))
@@ -982,7 +982,7 @@ bool Master_info_index::init_all_master_info()
sql_print_information("Initialized Master_info from '%s'",
buf_master_info_file);
if (master_info_index->get_master_info(&connection_name,
- MYSQL_ERROR::WARN_LEVEL_NOTE))
+ Sql_condition::WARN_LEVEL_NOTE))
{
/* Master_info was already registered */
sql_print_error(ER(ER_CONNECTION_ALREADY_EXISTS),
@@ -1079,7 +1079,7 @@ bool Master_info_index::write_master_name_to_index_file(LEX_STRING *name,
Master_info *
Master_info_index::get_master_info(LEX_STRING *connection_name,
- MYSQL_ERROR::enum_warning_level warning)
+ Sql_condition::enum_warning_level warning)
{
Master_info *mi;
char buff[MAX_CONNECTION_NAME+1], *res;
@@ -1096,10 +1096,10 @@ Master_info_index::get_master_info(LEX_STRING *connection_name,
mi= (Master_info*) my_hash_search(&master_info_hash,
(uchar*) buff, buff_length);
- if (!mi && warning != MYSQL_ERROR::WARN_LEVEL_NOTE)
+ if (!mi && warning != Sql_condition::WARN_LEVEL_NOTE)
{
my_error(WARN_NO_MASTER_INFO,
- MYF(warning == MYSQL_ERROR::WARN_LEVEL_WARN ? ME_JUST_WARNING :
+ MYF(warning == Sql_condition::WARN_LEVEL_WARN ? ME_JUST_WARNING :
0),
(int) connection_name->length,
connection_name->str);
@@ -1118,7 +1118,7 @@ bool Master_info_index::check_duplicate_master_info(LEX_STRING *name_arg,
/* Get full host and port name */
if ((mi= master_info_index->get_master_info(name_arg,
- MYSQL_ERROR::WARN_LEVEL_NOTE)))
+ Sql_condition::WARN_LEVEL_NOTE)))
{
if (!host)
host= mi->host;
@@ -1182,7 +1182,7 @@ bool Master_info_index::remove_master_info(LEX_STRING *name)
Master_info* mi;
DBUG_ENTER("remove_master_info");
- if ((mi= get_master_info(name, MYSQL_ERROR::WARN_LEVEL_WARN)))
+ if ((mi= get_master_info(name, Sql_condition::WARN_LEVEL_WARN)))
{
// Delete Master_info and rewrite others to file
if (!my_hash_delete(&master_info_hash, (uchar*) mi))
@@ -1294,7 +1294,7 @@ bool Master_info_index::start_all_slaves(THD *thd)
break;
}
else
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
+ push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE,
ER_SLAVE_STARTED, ER(ER_SLAVE_STARTED),
(int) mi->connection_name.length,
mi->connection_name.str);
@@ -1339,7 +1339,7 @@ bool Master_info_index::stop_all_slaves(THD *thd)
break;
}
else
- push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
+ push_warning_printf(thd, Sql_condition::WARN_LEVEL_NOTE,
ER_SLAVE_STOPPED, ER(ER_SLAVE_STOPPED),
(int) mi->connection_name.length,
mi->connection_name.str);