summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-12-03 20:34:50 +0100
committerSergei Golubchik <serg@mariadb.org>2016-12-06 09:45:50 +0100
commitb5aa0f437fc595d508b9eb5d36185fd8cbaa62eb (patch)
tree303c8abb53b69d8d377dd97f3cc5ee4114f1d6ad /sql/log_event.cc
parent952856c810c7a44678960a455062531279ddf113 (diff)
downloadmariadb-git-b5aa0f437fc595d508b9eb5d36185fd8cbaa62eb.tar.gz
MDEV-11319 mysqlbinlog crashes or fails with out of memory while reading some encrypted binlogs
support encrypted binlogs. Not decryption, but at least recognizing that event are encrypted and prining them as such
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index de6528638f0..ced262657fb 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -1514,6 +1514,10 @@ err:
if (error)
{
DBUG_ASSERT(!res);
+#ifdef MYSQL_CLIENT
+ if (force_opt)
+ DBUG_RETURN(new Unknown_log_event());
+#endif
if (event.length() >= OLD_HEADER_LEN)
sql_print_error("Error in Log_event::read_log_event(): '%s',"
" data_len: %lu, event_type: %d", error,
@@ -8182,8 +8186,13 @@ void Unknown_log_event::print(FILE* file_arg, PRINT_EVENT_INFO* print_event_info
if (print_event_info->short_form)
return;
- print_header(&cache, print_event_info, FALSE);
- my_b_printf(&cache, "\n# %s", "Unknown event\n");
+ if (what != ENCRYPTED)
+ {
+ print_header(&cache, print_event_info, FALSE);
+ my_b_printf(&cache, "\n# Unknown event\n");
+ }
+ else
+ my_b_printf(&cache, "# Encrypted event\n");
}
#endif