diff options
author | Kristian Nielsen <knielsen@knielsen-hq.org> | 2014-06-25 13:08:30 +0200 |
---|---|---|
committer | Kristian Nielsen <knielsen@knielsen-hq.org> | 2014-06-25 13:08:30 +0200 |
commit | 00467e136e5080e8c175019534ad198b7dcc35d3 (patch) | |
tree | 3b519789fae2ad61ea09ea65e5c7ba162b07cea7 /sql/log_event.h | |
parent | 5591ef0184ae698b94e05cd8c4960effed22405a (diff) | |
download | mariadb-git-00467e136e5080e8c175019534ad198b7dcc35d3.tar.gz |
MDEV-5799: Error messages written upon LOST EVENTS incident are corrupted
This is MySQL Bug#59123. The message string stored in an INCIDENT event was
not zero-terminated. This caused any following checksum bytes (if enabled on
the master) to be output to the error log as trailing garbage when the message
was printed to the error log.
Backport the patch from MySQL 5.6:
revno: 2876.228.200
revision-id: zhenxing.he@sun.com-20110111051323-w2xnzvcjn46x6h6u
committer: He Zhenxing <zhenxing.he@sun.com>
timestamp: Tue 2011-01-11 13:13:23 +0800
message:
BUG#59123 rpl_stm_binlog_max_cache_size fails sporadically with found warnings
Also add a test case.
Diffstat (limited to 'sql/log_event.h')
-rw-r--r-- | sql/log_event.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sql/log_event.h b/sql/log_event.h index 2091d968558..c0370014c7d 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -4686,7 +4686,16 @@ public: { DBUG_ENTER("Incident_log_event::Incident_log_event"); DBUG_PRINT("enter", ("m_incident: %d", m_incident)); - m_message= msg; + m_message.str= NULL; + m_message.length= 0; + if (!(m_message.str= (char*) my_malloc(msg.length+1, MYF(MY_WME)))) + { + /* Mark this event invalid */ + m_incident= INCIDENT_NONE; + DBUG_VOID_RETURN; + } + strmake(m_message.str, msg.str, msg.length); + m_message.length= msg.length; set_direct_logging(); /* Replicate the incident irregardless of @@skip_replication. */ flags&= ~LOG_EVENT_SKIP_REPLICATION_F; |