From 4cb4593bdea737037c4d01bd3fbd7faa2bde5d22 Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Tue, 16 Jun 2009 16:04:30 +0100 Subject: BUG#45511 rpl.rpl_binlog_corruption fails with warning messages in Valgrind This is a backport of BUG#43076. --- sql/rpl_reporting.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sql/rpl_reporting.cc') diff --git a/sql/rpl_reporting.cc b/sql/rpl_reporting.cc index 28f257790c7..a09140de3c4 100644 --- a/sql/rpl_reporting.cc +++ b/sql/rpl_reporting.cc @@ -13,6 +13,7 @@ Slave_reporting_capability::report(loglevel level, int err_code, va_list args; va_start(args, msg); + pthread_mutex_lock(&err_lock); switch (level) { case ERROR_LEVEL: @@ -38,6 +39,7 @@ Slave_reporting_capability::report(loglevel level, int err_code, my_vsnprintf(pbuff, pbuffsize, msg, args); + pthread_mutex_unlock(&err_lock); va_end(args); /* If the msg string ends with '.', do not add a ',' it would be ugly */ @@ -46,3 +48,8 @@ Slave_reporting_capability::report(loglevel level, int err_code, (pbuff[0] && *(strend(pbuff)-1) == '.') ? "" : ",", err_code); } + +Slave_reporting_capability::~Slave_reporting_capability() +{ + pthread_mutex_destroy(&err_lock); +} -- cgit v1.2.1