Commit aee03ea5 authored by Brandon Nesterenko's avatar Brandon Nesterenko Committed by Oleksandr Byelkin

11.5 Fix Merge Conflict Between MDEV-7850 and MDEV-33672

MDEV-33672 (10.6) added checks/tests for malformed events which end
before the flags describe (which would lead to reading of un-owned
memory). MDEV-7850 (11.5) extended all GTID events with a thread id
at the end of the event. This GTID event extension invalidates the
tests added in MDEV-33672 because the thread id is appended after the
event (and thereby the event isn't cut short).

This patch fixes these MDEV-33672 tests by not writing the GTID
thread id when writing the Gtid events just for these tests. This
preserves tests for backwards compatibility, rather than getting rid
of the tests altogether.
parent dd7d9d7f
...@@ -2970,6 +2970,19 @@ Gtid_log_event::write(Log_event_writer *writer) ...@@ -2970,6 +2970,19 @@ Gtid_log_event::write(Log_event_writer *writer)
} }
} }
#ifndef DBUG_OFF
/*
The following debug_dbug flags which simulate invalid events are only
valid for pre-FL_EXTRA_THREAD_ID events (i.e. before 11.5). So do not write
the thread id attribute when simulating these invalid events.
*/
if (DBUG_IF("negate_xid_from_gtid") ||
DBUG_IF("negate_xid_data_from_gtid") ||
DBUG_IF("inject_fl_extra_multi_engine_into_gtid") ||
DBUG_IF("negate_alter_fl_from_gtid"))
flags_extra&= ~FL_EXTRA_THREAD_ID;
#endif
DBUG_EXECUTE_IF("inject_fl_extra_multi_engine_into_gtid", { DBUG_EXECUTE_IF("inject_fl_extra_multi_engine_into_gtid", {
flags_extra|= FL_EXTRA_MULTI_ENGINE_E1; flags_extra|= FL_EXTRA_MULTI_ENGINE_E1;
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment