mariadb/mysql-test/t/variables_debug.test
Alexey Kopytov faf54ff95c Bug #56709: Memory leaks at running the 5.1 test suite
Fixed a number of memory leaks discovered by valgrind.

dbug/dbug.c:
  This is actually an addendum to the fix for bug #52629:
  
  - there is no point in limiting the fix to just global
  variables, session ones are also affected.
  - zero all fields when allocating a new 'state' structure so
  that FreeState() does not deal with unitialized data later.
  - add a check for a NULL pointer in DBUGCloseFile()
mysql-test/r/partition_error.result:
  Added a test case for bug #56709.
mysql-test/r/variables_debug.result:
  Added a test case for bug #56709.
mysql-test/t/partition_error.test:
  Added a test case for bug #56709.
mysql-test/t/variables_debug.test:
  Added a test case for bug #56709.
sql/item_timefunc.cc:
  There is no point in declaring 'value' as a member of
  Item_extract and dynamically allocating memory for it in
  Item_extract::fix_length_and_dec(), since this string is only
  used as a temporary storage in Item_extract::val_int().
sql/item_timefunc.h:
  Removed 'value' from the Item_extract class definition.
sql/sql_load.cc:
  - we may need to deallocate 'buffer' even when 'error' is
    non-zero in some cases, since 'error' is public, and there is
    external code modifying it.
  - assign NULL to buffer when deallocating it so that we don't
    do it twice in the destructor
  - there is no point in changing 'error' in the destructor.
2010-09-22 23:33:18 +04:00

41 lines
721 B
Text

--source include/have_debug.inc
SET @old_debug = @@GLOBAL.debug;
#
# Bug#34678 @@debug variable's incremental mode
#
set debug= 'T';
select @@debug;
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;
SET GLOBAL debug=@old_debug;
--echo #
--echo # Bug #56709: Memory leaks at running the 5.1 test suite
--echo #
SET @old_local_debug = @@debug;
SET @@debug='d,foo';
SELECT @@debug;
SET @@debug='';
SELECT @@debug;
SET @@debug = @old_local_debug;
--echo End of 5.1 tests