summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-10-02 22:35:13 +0400
committerAlexander Barkov <bar@mariadb.org>2017-10-02 22:35:13 +0400
commit8ae8cd63485eb063de0b70ea6f3acf7102a61fef (patch)
tree70fa448baa769b6c8c331063a61bf929ad61c976 /sql/slave.cc
parent6857cb57fe7090f131b272f31485b7a478a0b324 (diff)
parent387bdf07ae0973bc3e4dc3f5064d2a29c64bb769 (diff)
downloadmariadb-git-8ae8cd63485eb063de0b70ea6f3acf7102a61fef.tar.gz
Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index 00dc02a6f48..86675b4f19c 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -3462,11 +3462,11 @@ sql_delay_event(Log_event *ev, THD *thd, rpl_group_info *rgi)
"ev->when= %lu "
"rli->mi->clock_diff_with_master= %lu "
"now= %ld "
- "sql_delay_end= %lu "
+ "sql_delay_end= %llu "
"nap_time= %ld",
sql_delay, (long)ev->when,
rli->mi->clock_diff_with_master,
- (long)now, sql_delay_end, (long)nap_time));
+ (long)now, (ulonglong)sql_delay_end, (long)nap_time));
if (sql_delay_end > now)
{
@@ -4523,12 +4523,12 @@ Stopping slave I/O thread due to out-of-memory error from master");
lastchecktime = currenttime;
if(tokenamount < network_read_len)
{
- ulonglong micro_time = 1000*1000 * (network_read_len - tokenamount) / speed_limit_in_bytes ;
- ulonglong second_time = micro_time / (1000 * 1000);
- micro_time = micro_time % (1000 * 1000);
+ ulonglong duration =1000ULL*1000 * (network_read_len - tokenamount) / speed_limit_in_bytes;
+ time_t second_time = (time_t)(duration / (1000 * 1000));
+ uint micro_time = duration % (1000 * 1000);
// at least sleep 1000 micro second
- my_sleep(micro_time > 1000 ? micro_time : 1000);
+ my_sleep(MY_MAX(micro_time,1000));
/*
If it sleep more than one second,