summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-11-08 09:39:37 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2018-11-08 09:39:37 +0200
commit2767cb76d4b55818eac11100cca208b54f79d1fd (patch)
tree4bfb274f90ebf9990c45918f0db91294304c79ec /sql/slave.cc
parenta91109846c74a69bfa0fef054954ac9ae675765e (diff)
parent4142589207649e3317adc8c0d371897b7cb53733 (diff)
downloadmariadb-git-2767cb76d4b55818eac11100cca208b54f79d1fd.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index 77d9811f288..16fa890d86c 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -4306,7 +4306,15 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli,
*/
if (!(ev->is_artificial_event() || ev->is_relay_log_event() || (ev->when == 0)))
{
- rli->last_master_timestamp= ev->when + (time_t) ev->exec_time;
+ /*
+ Ignore FD's timestamp as it does not reflect the slave execution
+ state but likely to reflect a deep past. Consequently when the first
+ data modification event execution last long all this time
+ Seconds_Behind_Master is zero.
+ */
+ if (ev->get_type_code() != FORMAT_DESCRIPTION_EVENT)
+ rli->last_master_timestamp= ev->when + (time_t) ev->exec_time;
+
DBUG_ASSERT(rli->last_master_timestamp >= 0);
}
}