summaryrefslogtreecommitdiff
path: root/sql/slave.cc
diff options
context:
space:
mode:
authorunknown <mats@romeo.(none)>2006-10-10 15:18:21 +0200
committerunknown <mats@romeo.(none)>2006-10-10 15:18:21 +0200
commit571f0c183829662382b4dc0286349d8e310f8a65 (patch)
tree5403ef4027c1074875db3c64d30112ab7f0a762f /sql/slave.cc
parent9f0ad61b02ca96fd212df6b92786fe7a196f4309 (diff)
downloadmariadb-git-571f0c183829662382b4dc0286349d8e310f8a65.tar.gz
BUG#21474 (There is a rotation before the last table map):
Removing code to step the group log position and just stepping the event log position. If the group log position were stepped one time too many, it might be that the group starts at a position that is not possible, e.g., at a Rows_log_event, or between an Intvar_log_event and the following associated Query_log_event. sql/log_event.cc: Removing code to step the group log position and just stepping the event log position. If the group log position were stepped one time too many, it might be that the group starts at a position that is not possible, e.g., at a Rows_log_event, or between an Intvar_log_event and the following associated Query_log_event. sql/slave.cc: Removing code to step the group log position and just stepping the event log position when executing a Format_description_log_event. If the group log position were stepped one time too many, it might be that the group starts at a position that is not possible, e.g., at a Rows_log_event, or between an Intvar_log_event and the following associated Query_log_event.
Diffstat (limited to 'sql/slave.cc')
-rw-r--r--sql/slave.cc27
1 files changed, 16 insertions, 11 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index f9645fc83e3..f9a847b9c26 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -3101,17 +3101,22 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli)
type_code != START_EVENT_V3 && type_code!= FORMAT_DESCRIPTION_EVENT))
{
DBUG_PRINT("info", ("event skipped"));
- if (thd->options & OPTION_BEGIN)
- rli->inc_event_relay_log_pos();
- else
- {
- rli->inc_group_relay_log_pos((type_code == ROTATE_EVENT ||
- type_code == STOP_EVENT ||
- type_code == FORMAT_DESCRIPTION_EVENT) ?
- LL(0) : ev->log_pos,
- 1/* skip lock*/);
- flush_relay_log_info(rli);
- }
+ /*
+ We only skip the event here and do not increase the group log
+ position. In the event that we have to restart, this means
+ that we might have to skip the event again, but that is a
+ minor issue.
+
+ If we were to increase the group log position when skipping an
+ event, it might be that we are restarting at the wrong
+ position and have events before that we should have executed,
+ so not increasing the group log position is a sure bet in this
+ case.
+
+ In this way, we just step the group log position when we
+ *know* that we are at the end of a group.
+ */
+ rli->inc_event_relay_log_pos();
/*
Protect against common user error of setting the counter to 1