From 69c540588a627bad4875373953b2923d840a2c25 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Thu, 26 Nov 2009 11:16:06 +0100 Subject: [PATCH 1/3] Bug #48250 mysqtest_embedded can lock destroyed mutex As suggested, replaced relevant uses of my_fopen with fopen (and close) Tested on HPUX where it was reproducable with test innodb_bug30919 --- client/mysqltest.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index cfcabb5a5ab..3cd87bd3236 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -1119,7 +1119,7 @@ void close_files() if (cur_file->file && cur_file->file != stdin) { DBUG_PRINT("info", ("closing file: %s", cur_file->file_name)); - my_fclose(cur_file->file, MYF(0)); + fclose(cur_file->file); } my_free((uchar*) cur_file->file_name, MYF(MY_ALLOW_ZERO_PTR)); cur_file->file_name= 0; @@ -2441,7 +2441,7 @@ int open_file(const char *name) if (cur_file == file_stack_end) die("Source directives are nesting too deep"); cur_file++; - if (!(cur_file->file = my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(0)))) + if (!(cur_file->file = fopen(buff, "rb"))) { cur_file--; die("Could not open '%s' for reading, errno: %d", buff, errno); @@ -5286,7 +5286,7 @@ int read_line(char *buf, int size) found_eof: if (cur_file->file != stdin) { - my_fclose(cur_file->file, MYF(0)); + fclose(cur_file->file); cur_file->file= 0; } my_free((uchar*) cur_file->file_name, MYF(MY_ALLOW_ZERO_PTR)); @@ -5865,7 +5865,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), fn_format(buff, argument, "", "", MY_UNPACK_FILENAME); DBUG_ASSERT(cur_file == file_stack && cur_file->file == 0); if (!(cur_file->file= - my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(0)))) + fopen(buff, "rb"))) die("Could not open '%s' for reading, errno: %d", buff, errno); cur_file->file_name= my_strdup(buff, MYF(MY_FAE)); cur_file->lineno= 1; From 22d80703efc8b1f548bce62dd2e785a83a3100ba Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Thu, 26 Nov 2009 11:23:30 +0100 Subject: [PATCH 2/3] Bug #49096 mtr: --mem option should be ignored on Windows Ignored w/message in v1 and v2 --- mysql-test/lib/v1/mysql-test-run.pl | 5 +++++ mysql-test/mysql-test-run.pl | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/mysql-test/lib/v1/mysql-test-run.pl b/mysql-test/lib/v1/mysql-test-run.pl index 86ad5c485c1..9630c65ade4 100755 --- a/mysql-test/lib/v1/mysql-test-run.pl +++ b/mysql-test/lib/v1/mysql-test-run.pl @@ -905,6 +905,11 @@ sub command_line_setup () { mtr_report("Using default engine '$used_default_engine'") if defined $used_default_engine; + if ($glob_win32 and defined $opt_mem) { + mtr_report("--mem not supported on Windows, ignored"); + $opt_mem= undef; + } + # -------------------------------------------------------------------------- # Check if we should speed up tests by trying to run on tmpfs # -------------------------------------------------------------------------- diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 2147b4ae7a7..e7f8e90dc44 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1080,6 +1080,11 @@ sub command_line_setup { } } + if (IS_WINDOWS and defined $opt_mem) { + mtr_report("--mem not supported on Windows, ignored"); + $opt_mem= undef; + } + # -------------------------------------------------------------------------- # Check if we should speed up tests by trying to run on tmpfs # -------------------------------------------------------------------------- From 50ab925e046f197daa97057158fda532f6fe1c81 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Thu, 26 Nov 2009 11:34:16 +0100 Subject: [PATCH 3/3] Bug #48918 MTR uses an un-initialized value in comparison mysqld->{proc} not defined for an embedded server Check only if {proc} defined --- mysql-test/mysql-test-run.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index e7f8e90dc44..7d2426459d0 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -3893,7 +3893,7 @@ sub check_expected_crash_and_restart { foreach my $mysqld ( mysqlds() ) { - next unless ( $mysqld->{proc} eq $proc ); + next unless ( $mysqld->{proc} and $mysqld->{proc} eq $proc ); # Check if crash expected by looking at the .expect file # in var/tmp