Skip to content

Commit 76c79d4

Browse files
ParadoxV5grooverdan
authored andcommitted
MDEV-37060: Don’t check Encrpyted Server IDs in mariadb-binlog
MSAN found that `mariadb-binlog --force-read` checks encrypted events too for whether `--do-server-ids`/`ignore-server-ids` includes any of their (uninitialized) Server IDs. This fix extends the condition to stop skipping `UNKNOWN_EVENT`s by Server ID in addition to `ROTATE_EVENT`s. An alternative solution is to zero-initialize the `server_id` field of `Unknown_log_event` or even its supertype, `Log_event`. Though to avoid hiding `use-of-uninitialized-value` mistakes in the future, leaving unset fields uninitialized is more assured; not to mention the potential of ID 0 still in use. Reviewed-by: Brandon Nesterenko <brandon.nesterenko@mariadb.com> Acked-by: Daniel Black <daniel@mariadb.org>
1 parent 687c8be commit 76c79d4

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

client/mysqlbinlog.cc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,9 +1201,16 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
12011201
binlog, even if they have a server_id. Also, we have to read
12021202
the format_description event so that we can parse subsequent
12031203
events.
1204+
Don't skip Unknown events either since we don't know their `server_id`s.
12041205
*/
1205-
if (ev_type != ROTATE_EVENT && is_server_id_excluded(ev->server_id))
1206-
goto end;
1206+
switch (ev_type) {
1207+
case ROTATE_EVENT:
1208+
case UNKNOWN_EVENT:
1209+
break;
1210+
default:
1211+
if (is_server_id_excluded(ev->server_id))
1212+
goto end;
1213+
}
12071214
}
12081215
if ((ev->when >= stop_datetime)
12091216
|| (pos >= stop_position_mot))

0 commit comments

Comments
 (0)