From 16fadb10b5d2a9328b5caa85963a3d851b35cef4 Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Fri, 16 Apr 2010 10:30:53 +0300 Subject: Bug #52629: memory leak from sys_var_thd_dbug in binlog.binlog_write_error When re-setting (SET GLOBAL debug='') the GLOBAL debug settings the server was not freeing the data elements from the top (initial) frame before setting them to 0 without freeing the underlying memory. As these are global settings there's a chance that something is there already. Fixed by : 1. making sure the allocated data are cleaned up before re-setting them while parsing a debug string 2. making sure the stuff allocated in the global settings is freed on shutdown. --- mysql-test/t/variables_debug.test | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'mysql-test/t/variables_debug.test') diff --git a/mysql-test/t/variables_debug.test b/mysql-test/t/variables_debug.test index 7dcaf246803..8f2bde7ae42 100644 --- a/mysql-test/t/variables_debug.test +++ b/mysql-test/t/variables_debug.test @@ -10,3 +10,16 @@ set debug= '+P'; select @@debug; set debug= '-P'; select @@debug; + +--echo # +--echo # Bug #52629: memory leak from sys_var_thd_dbug in +--echo # binlog.binlog_write_error +--echo # + +SET GLOBAL debug='d,injecting_fault_writing'; +SELECT @@global.debug; +SET GLOBAL debug=''; +SELECT @@global.debug; + + +--echo End of 5.1 tests -- cgit v1.2.1