From 49ca12a107d6a6f3e18729e6481090077b1f1bf8 Mon Sep 17 00:00:00 2001 From: Michael Widenius Date: Wed, 12 Mar 2014 11:24:03 +0200 Subject: [PATCH] Fixed some failing tests Remove memory warnings if mysql client aborts early Changed copyright for clients client/mysql.cc: Free memory if get_options fails, so that we don't get warnings from safemalloc include/welcome_copyright_notice.h: Added SkySQL to client copyrights mysql-test/valgrind.supp: Added suppressions for memory leaks from dlopen() for OpenSUSE 12.3 storage/oqgraph/mysql-test/oqgraph/regression_mdev5744.result: Suppress warning storage/oqgraph/mysql-test/oqgraph/regression_mdev5744.test: Suppress warning --- client/mysql.cc | 12 +++++------ include/welcome_copyright_notice.h | 2 +- mysql-test/valgrind.supp | 20 +++++++++++++++++++ .../oqgraph/regression_mdev5744.result | 1 + .../oqgraph/regression_mdev5744.test | 2 ++ 5 files changed, 29 insertions(+), 8 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index b95f5742a11..ca7cb7dd910 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1,6 +1,7 @@ /* Copyright (c) 2000, 2013, Oracle and/or its affiliates. Copyright (c) 2009, 2013, Monty Program Ab. + Copyright (c) 2013, 2014, SkySQL Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1176,12 +1177,9 @@ int main(int argc,char *argv[]) exit(1); } defaults_argv=argv; - if (get_options(argc, (char **) argv)) - { - free_defaults(defaults_argv); - my_end(0); - exit(1); - } + if ((status.exit_status= get_options(argc, (char **) argv))) + mysql_end(-1); + if (status.batch && !status.line_buff && !(status.line_buff= batch_readline_init(MAX_BATCH_BUFFER_SIZE, stdin))) { @@ -1877,7 +1875,7 @@ static int get_options(int argc, char **argv) opt_net_buffer_length= *mysql_params->p_net_buffer_length; if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option))) - exit(ho_error); + return(ho_error); *mysql_params->p_max_allowed_packet= opt_max_allowed_packet; *mysql_params->p_net_buffer_length= opt_net_buffer_length; diff --git a/include/welcome_copyright_notice.h b/include/welcome_copyright_notice.h index 875770edb89..ff2d1fea3b1 100644 --- a/include/welcome_copyright_notice.h +++ b/include/welcome_copyright_notice.h @@ -25,6 +25,6 @@ */ #define ORACLE_WELCOME_COPYRIGHT_NOTICE(first_year) \ "Copyright (c) " first_year ", " COPYRIGHT_NOTICE_CURRENT_YEAR \ - ", Oracle, Monty Program Ab and others.\n" + ", Oracle, SkySQL Ab and others.\n" #endif /* _welcome_copyright_notice_h_ */ diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp index 25f1c403a61..45499e5891f 100644 --- a/mysql-test/valgrind.supp +++ b/mysql-test/valgrind.supp @@ -592,6 +592,26 @@ fun:dl_open_worker } +{ + libc pthread_exit 9 + Memcheck:Leak + fun:malloc + fun:local_strdup + fun:_dl_map_object + fun:openaux + fun:_dl_catch_error +} + +{ + libc do_lookup_x + Memcheck:Leak + fun:calloc + fun:do_lookup_x + fun:_dl_lookup_symbol_x + ... + fun:_dl_catch_error +} + # # This is seen internally in the system libraries on 64-bit RHAS3. # diff --git a/storage/oqgraph/mysql-test/oqgraph/regression_mdev5744.result b/storage/oqgraph/mysql-test/oqgraph/regression_mdev5744.result index efe520e16a5..731c6726247 100644 --- a/storage/oqgraph/mysql-test/oqgraph/regression_mdev5744.result +++ b/storage/oqgraph/mysql-test/oqgraph/regression_mdev5744.result @@ -1,5 +1,6 @@ DROP TABLE IF EXISTS graph_base; DROP TABLE IF EXISTS graph; +call mtr.add_suppression("graph_base is open on delete"); CREATE TABLE graph_base ( from_id INT UNSIGNED NOT NULL, to_id INT UNSIGNED NOT NULL, diff --git a/storage/oqgraph/mysql-test/oqgraph/regression_mdev5744.test b/storage/oqgraph/mysql-test/oqgraph/regression_mdev5744.test index 9ba30ee2f76..19cbfe7dbe3 100644 --- a/storage/oqgraph/mysql-test/oqgraph/regression_mdev5744.test +++ b/storage/oqgraph/mysql-test/oqgraph/regression_mdev5744.test @@ -7,6 +7,8 @@ DROP TABLE IF EXISTS graph_base; DROP TABLE IF EXISTS graph; --enable_warnings +call mtr.add_suppression("graph_base is open on delete"); + # Create the backing store CREATE TABLE graph_base ( from_id INT UNSIGNED NOT NULL,