summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-10-09 13:25:11 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-10-09 13:25:11 +0300
commit892378fb9def2cd38db8c1b0adcb66be2f72e86a (patch)
treec012561a43062907d90171878007b02d11412f93 /sql/log_event.cc
parentf11d425a15e53d4b206146a9d52f5be324247826 (diff)
parentc65cb244b35412ef54192b17120f7ace8a8af5fd (diff)
downloadmariadb-git-892378fb9def2cd38db8c1b0adcb66be2f72e86a.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc34
1 files changed, 18 insertions, 16 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 15523ba0c36..dc7203fc94f 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -2096,6 +2096,19 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len,
alg != BINLOG_CHECKSUM_ALG_OFF))
event_len= event_len - BINLOG_CHECKSUM_LEN;
+ /*
+ Create an object of Ignorable_log_event for unrecognized sub-class.
+ So that SLAVE SQL THREAD will only update the position and continue.
+ We should look for this flag first instead of judging by event_type
+ Any event can be Ignorable_log_event if it has this flag on.
+ look into @note of Ignorable_log_event
+ */
+ if (uint2korr(buf + FLAGS_OFFSET) & LOG_EVENT_IGNORABLE_F)
+ {
+ ev= new Ignorable_log_event(buf, fdle,
+ get_type_str((Log_event_type) event_type));
+ goto exit;
+ }
switch(event_type) {
case QUERY_EVENT:
ev = new Query_log_event(buf, event_len, fdle, QUERY_EVENT);
@@ -2222,24 +2235,13 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len,
ev = new Start_encryption_log_event(buf, event_len, fdle);
break;
default:
- /*
- Create an object of Ignorable_log_event for unrecognized sub-class.
- So that SLAVE SQL THREAD will only update the position and continue.
- */
- if (uint2korr(buf + FLAGS_OFFSET) & LOG_EVENT_IGNORABLE_F)
- {
- ev= new Ignorable_log_event(buf, fdle,
- get_type_str((Log_event_type) event_type));
- }
- else
- {
- DBUG_PRINT("error",("Unknown event code: %d",
- (uchar) buf[EVENT_TYPE_OFFSET]));
- ev= NULL;
- break;
- }
+ DBUG_PRINT("error",("Unknown event code: %d",
+ (uchar) buf[EVENT_TYPE_OFFSET]));
+ ev= NULL;
+ break;
}
}
+exit:
if (ev)
{