diff options
author | He Zhenxing <zhenxing.he@sun.com> | 2009-10-02 16:18:40 +0800 |
---|---|---|
committer | He Zhenxing <zhenxing.he@sun.com> | 2009-10-02 16:18:40 +0800 |
commit | bb6953d1d80e5fef2e333e0a4147aa5a43e809ab (patch) | |
tree | 237d3b2bcf002c27bf44f70a7bb90f0236fae8f7 /mysql-test/t | |
parent | f509a3589653575f1e9dc9f05de11a86be710a68 (diff) | |
download | mariadb-git-bb6953d1d80e5fef2e333e0a4147aa5a43e809ab.tar.gz |
Backport BUG#38468 Memory leak detected when using mysqlbinlog utility
There were two memory leaks in mysqlbinlog command, one was already
fixed by previous patches, another one was that defaults_argv was
set to the value of argv after parse_args, in which called
handle_options after calling load_defaults and changed the value
of argv, and caused the memory allocated for defaults arguments
not freed.
Fixed the problem by setting defaults_argv right after calling
load_defaults.
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/mysqlbinlog.test | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index 015d4d152cb..04fb5486f31 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -380,3 +380,27 @@ FLUSH LOGS; --echo End of 5.0 tests --echo End of 5.1 tests + +# +# BUG#38468 Memory leak detected when using mysqlbinlog utility; +# +disable_query_log; +RESET MASTER; +CREATE TABLE t1 SELECT 1; +FLUSH LOGS; +DROP TABLE t1; +enable_query_log; + +# Write an empty file for comparison +write_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn.empty; +EOF + +# Before fix of BUG#38468, this would generate some warnings +--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000001 >/dev/null 2> $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn + +# Make sure the command above does not generate any error or warnings +diff_files $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn.empty; + +# Cleanup for this part of test +remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn.empty; +remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.warn; |