From 4daea2f8b69417881b4f123a252954f22b499df1 Mon Sep 17 00:00:00 2001 From: lilinjie <1136268146@qq.com> Date: Fri, 31 Mar 2023 14:11:04 +0800 Subject: fix typo Signed-off-by: lilinjie <1136268146@qq.com> --- sql/log.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/log.cc') diff --git a/sql/log.cc b/sql/log.cc index d2cbb49e280..8c75ae847b3 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -408,7 +408,7 @@ private: Rows_log_event *m_pending; /* - Bit flags for what has been writting to cache. Used to + Bit flags for what has been writing to cache. Used to discard logs without any data changes. see enum_logged_status; */ -- cgit v1.2.1 From d3e7dba329f517072c80b81cd17e9a67e2748729 Mon Sep 17 00:00:00 2001 From: Brandon Nesterenko Date: Wed, 28 Sep 2022 12:34:44 -0600 Subject: MDEV-28798: Previously Binlog Encrypted Master Segfaults on Binlog Dump with Using_Gtid=Slave_Pos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: ======== A master can segfault if it can't set up decryption for its binary log during a binlog dump with Using_Gtid=Slave_Pos. If slave connects using GTID mode, the master will call into log.cc::get_gtid_list_event(), which iterate through binlog events looking for a Gtid_list_log_event. On an encrypted binlog that the master cannot decrypt, the first event will be a START_ENCRYPTION_EVENT which will call into the following decryption branch if (fdle->start_decryption((Start_encryption_log_event*) ev)) errormsg= ‘Could not set up decryption for binlog.’; The event iteration however, does not stop in spite of this error. The master will try to read the next event, but segfault while trying to decrypt it because decryption failed to initialize. Solution: ======== Break the event iteration if decryption cannot be set up. Reviewed By: ============ Andrei Elkin --- sql/log.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sql/log.cc') diff --git a/sql/log.cc b/sql/log.cc index 8c75ae847b3..38ab6db746c 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -10786,7 +10786,10 @@ get_gtid_list_event(IO_CACHE *cache, Gtid_list_log_event **out_gtid_list) if (typ == START_ENCRYPTION_EVENT) { if (fdle->start_decryption((Start_encryption_log_event*) ev)) + { errormsg= "Could not set up decryption for binlog."; + break; + } } delete ev; if (typ == ROTATE_EVENT || typ == STOP_EVENT || -- cgit v1.2.1