summaryrefslogtreecommitdiff
path: root/sql/log_event.h
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.h
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.h')
-rw-r--r--sql/log_event.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/log_event.h b/sql/log_event.h
index bc850c22a14..90900f63533 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -1149,7 +1149,7 @@ public:
return thd ? thd->db : 0;
}
#else
- Log_event() : temp_buf(0), flags(0) {}
+ Log_event() : temp_buf(0), when(0), flags(0) {}
ha_checksum crc;
/* print*() functions are used by mysqlbinlog */
virtual void print(FILE* file, PRINT_EVENT_INFO* print_event_info) = 0;
@@ -3677,6 +3677,7 @@ private:
class Unknown_log_event: public Log_event
{
public:
+ enum { UNKNOWN, ENCRYPTED } what;
/*
Even if this is an unknown event, we still pass description_event to
Log_event's ctor, this way we can extract maximum information from the
@@ -3684,8 +3685,10 @@ public:
*/
Unknown_log_event(const char* buf,
const Format_description_log_event *description_event):
- Log_event(buf, description_event)
+ Log_event(buf, description_event), what(UNKNOWN)
{}
+ /* constructor for hopelessly corrupted events */
+ Unknown_log_event(): Log_event(), what(ENCRYPTED) {}
~Unknown_log_event() {}
void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
Log_event_type get_type_code() { return UNKNOWN_EVENT;}