From 77d6d403c6a8b6462c790ddaa62efe6741350b9f Mon Sep 17 00:00:00 2001 From: Sachin Setiya Date: Mon, 8 May 2017 18:02:46 +0530 Subject: MDEV-12290 Wrong timestamps in binary log causes replication issues Binlog_background_thread does not make a call to set_time(), And when we call binlog_checkpoint_log_event->write() , we write the wrong timestamp. In this patch we correct this by calling thd->set_time(). --- sql/log.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/log.cc b/sql/log.cc index a6ece712099..f865c52ac6d 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -9623,6 +9623,8 @@ binlog_background_thread(void *arg __attribute__((unused))) { THD_STAGE_INFO(thd, stage_binlog_processing_checkpoint_notify); DEBUG_SYNC(thd, "binlog_background_thread_before_mark_xid_done"); + /* Set the thread start time */ + thd->set_time(); /* Grab next pointer first, as mark_xid_done() may free the element. */ next= queue->next_in_queue; mysql_bin_log.mark_xid_done(queue->binlog_id, true); -- cgit v1.2.1