diff options
Diffstat (limited to 'sql/slave.cc')
-rw-r--r-- | sql/slave.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sql/slave.cc b/sql/slave.cc index 5177ac0d1b4..46932e36e95 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -3682,11 +3682,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) { @@ -4743,12 +4743,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, |