From 976e155985cb5868803eb8bd0b90fa2cf917e4e8 Mon Sep 17 00:00:00 2001 From: Andrei Elkin Date: Fri, 20 Nov 2009 15:30:35 +0200 Subject: Bug #48463 backporting from 6.0-rpl to celosia a set of bugs The mentioned on the bug report set of bugs fixes have not be pushed to the main trees. Fixed with extracting commits done to 6.0-rpl tree and applying them to the main 5.1. Notes. 1. part of changes - the mtr's specific - were packported to the main 5.0 tree for mtr v1 as http://lists.mysql.com/commits/46562 However, there is no that fix anymore in the mtr v2. (This fact was mailed to mtr maintaining people). 2. Bug@36929 crash in kill_zombie_dump_threads-> THD::awake() with replication tests is not backported because the base code of the patch is libevent and that was removed from the main trees due to its instability. client/mysqlbinlog.cc: fixes for BUG#35546 mysql-test/suite/rpl/r/rpl_bug41902.result: the new tests result file is added. mysql-test/suite/rpl/t/rpl_bug41902-slave.opt: conf file for bug41902 testing is added. mysql-test/suite/rpl/t/rpl_bug41902.test: regression tests for Bug #41902 is added. sql/log.cc: collection of changes due to Bug #48463. sql/log.h: collection of changes due to Bug #48463. sql/rpl_rli.h: collection of changes due to Bug #48463. sql/slave.cc: collection of changes due to Bug #48463. sql/sql_repl.cc: collection of changes due to Bug #48463. --- client/mysqlbinlog.cc | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'client') diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index a248ade353e..894a3ac9146 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -439,6 +439,7 @@ Exit_status Load_log_processor::process_first_event(const char *bname, { error("Could not construct local filename %s%s.", target_dir_name,bname); + my_free(fname, MYF(0)); delete ce; DBUG_RETURN(ERROR_STOP); } @@ -446,9 +447,15 @@ Exit_status Load_log_processor::process_first_event(const char *bname, rec.fname= fname; rec.event= ce; + /* + fname is freed in process_event() + after Execute_load_query_log_event or Execute_load_log_event + will have been processed, otherwise in Load_log_processor::destroy() + */ if (set_dynamic(&file_names, (uchar*)&rec, file_id)) { error("Out of memory."); + my_free(fname, MYF(0)); delete ce; DBUG_RETURN(ERROR_STOP); } @@ -828,7 +835,17 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, print_event_info->common_header_len= glob_description_event->common_header_len; ev->print(result_file, print_event_info); - ev->temp_buf= 0; // as the event ref is zeroed + if (!remote_opt) + { + ev->free_temp_buf(); // free memory allocated in dump_local_log_entries + } + else + { + /* + disassociate but not free dump_remote_log_entries time memory + */ + ev->temp_buf= 0; + } /* We don't want this event to be deleted now, so let's hide it (I (Guilhem) should later see if this triggers a non-serious Valgrind -- cgit v1.2.1