From bfb18f9ad5847b2c124f86b0516196e747fac5df Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Nov 2007 19:55:51 +0300 Subject: WL#3949, second part. Added soft switching of the binlog format (w/o restart a server) mysql-test/lib/mtr_cases.pl: updated the code for combination mysql-test/mysql-test-run.pl: added soft switching of binlog format mysql-test/lib/mtr_misc.pl: added new sub mtr_diff_opts mysql-test/suite/rpl/r/rpl_invoked_features.result: updated result mysql-test/suite/rpl/t/rpl_invoked_features.test: updated test mysql-test/suite/rpl/t/rpl_misc_functions.test: updated test mysql-test/suite/rpl/t/rpl_session_var.test: updated test --- mysql-test/mysql-test-run.pl | 53 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 43 insertions(+), 10 deletions(-) (limited to 'mysql-test/mysql-test-run.pl') diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index a42f0559fd2..fd0b5cb98bb 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -792,20 +792,23 @@ sub command_line_setup () { # -------------------------------------------------------------------------- # Find out type of logging that are being used # -------------------------------------------------------------------------- - # NOTE if the default binlog format is changed, this has to be changed - $used_binlog_format= "statement"; if (!$opt_extern && $mysql_version_id >= 50100 ) { - $used_binlog_format= "mixed"; # Default value for binlog format - foreach my $arg ( @opt_extra_mysqld_opt ) { if ( $arg =~ /binlog[-_]format=(\S+)/ ) { - $used_binlog_format= $1; + $used_binlog_format= $1; } } - mtr_report("Using binlog format '$used_binlog_format'"); + if (defined $used_binlog_format) + { + mtr_report("Using binlog format '$used_binlog_format'"); + } + else + { + mtr_report("Using dynamic switching of binlog format"); + } } @@ -3304,6 +3307,7 @@ sub run_testcase_check_skip_test($) sub do_before_run_mysqltest($) { my $tinfo= shift; + my $args; # Remove old files produced by mysqltest my $base_file= mtr_match_extension($tinfo->{'result_file'}, @@ -3324,6 +3328,26 @@ sub do_before_run_mysqltest($) # if script decided to run mysqltest cluster _is_ installed ok $ENV{'NDB_STATUS_OK'} = "YES"; } + if (defined $tinfo->{"binlog_format"} and $mysql_version_id > 50100 ) + { + foreach my $server ((@$master,@$slave)) + { + if ($server->{'pid'}) + { + + mtr_init_args(\$args); + + mtr_add_arg($args, "--no-defaults"); + + mtr_add_arg($args, "--user=root"); + mtr_add_arg($args, "--port=$server->{'port'}"); + mtr_add_arg($args, "--socket=$server->{'path_sock'}"); + + mtr_run($exe_mysql, $args, "$glob_mysql_test_dir/include/set_binlog_format_".$tinfo->{"binlog_format"}.".inc", "", "", "", {}); + + } + } + } } } @@ -4218,10 +4242,19 @@ sub run_testcase_need_master_restart($) elsif (! mtr_same_opts($master->[0]->{'start_opts'}, $tinfo->{'master_opt'}) ) { - $do_restart= 1; - mtr_verbose("Restart master: running with different options '" . - join(" ", @{$tinfo->{'master_opt'}}) . "' != '" . - join(" ", @{$master->[0]->{'start_opts'}}) . "'" ); + # Chech that diff is binlog format only + my $diff_opts= mtr_diff_opts($master->[0]->{'start_opts'},$tinfo->{'master_opt'}); + if (scalar(@$diff_opts) eq 2) + { + $do_restart= 1 unless ($diff_opts->[0] =~/^--binlog-format=/ and $diff_opts->[1] =~/^--binlog-format=/); + } + else + { + $do_restart= 1; + mtr_verbose("Restart master: running with different options '" . + join(" ", @{$tinfo->{'master_opt'}}) . "' != '" . + join(" ", @{$master->[0]->{'start_opts'}}) . "'" ); + } } elsif( ! $master->[0]->{'pid'} ) { -- cgit v1.2.1 From 2d1f41a1968bd4830276f75beeafbe89eaa9a48e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Nov 2007 00:39:55 +0300 Subject: WL#3949, fix for 2nd part mysql-test/mysql-test-run.pl: updated mtr mysql-test/include/set_binlog_format_mixed.inc: set mixed binlog format mysql-test/include/set_binlog_format_row.inc: set row binlog format mysql-test/include/set_binlog_format_statement.inc: set statement binlog format --- mysql-test/mysql-test-run.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test/mysql-test-run.pl') diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index fd0b5cb98bb..bb520bdf617 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -3343,7 +3343,7 @@ sub do_before_run_mysqltest($) mtr_add_arg($args, "--port=$server->{'port'}"); mtr_add_arg($args, "--socket=$server->{'path_sock'}"); - mtr_run($exe_mysql, $args, "$glob_mysql_test_dir/include/set_binlog_format_".$tinfo->{"binlog_format"}.".inc", "", "", "", {}); + mtr_run($exe_mysql, $args, "include/set_binlog_format_".$tinfo->{"binlog_format"}.".inc", "", "", ""); } } -- cgit v1.2.1 From f2cff6b61e6c52ffd8e54403f03beceb8a103162 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 21 Nov 2007 23:44:31 +0300 Subject: WL#3949, added skip combinations for some conditions mysql-test/mysql-test-run.pl: added --skip-combination option mysql-test/lib/mtr_cases.pl: skip combination code for some conditions mysql-test/include/have_binlog_format_row_or_statement.inc: include file --- mysql-test/mysql-test-run.pl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'mysql-test/mysql-test-run.pl') diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index bb520bdf617..e17bbeb251f 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -165,6 +165,7 @@ our $opt_small_bench= 0; our $opt_big_test= 0; our @opt_combination; +our $opt_skip_combination; our @opt_extra_mysqld_opt; @@ -532,6 +533,7 @@ sub command_line_setup () { 'skip-test=s' => \$opt_skip_test, 'big-test' => \$opt_big_test, 'combination=s' => \@opt_combination, + 'skip-combination' => \$opt_skip_combination, # Specify ports 'master_port=i' => \$opt_master_myport, @@ -5179,6 +5181,7 @@ Options to control what test suites or cases to run checked from test cases. combination="ARG1 .. ARG2" Specify a set of "mysqld" arguments for one combination. + skip-combination Skip any combination options and combinations files Options that specify ports -- cgit v1.2.1 From 59574a6e601d6725492d9283a3d386df16eace32 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Nov 2007 13:29:31 +0100 Subject: WL#3949 Test should set binlog format dnamically - Reorganize collect a little to make it easier to apply optimizations and settings to collected test cases. - Add suite/rpl/combination file - Rename include/set_binlog_format_x.inc to .sql since thay are run by "mysql" mysql-test/include/set_binlog_format_mixed.sql: Rename: mysql-test/include/set_binlog_format_mixed.inc -> mysql-test/include/set_binlog_format_mixed.sql mysql-test/include/set_binlog_format_row.sql: Rename: mysql-test/include/set_binlog_format_row.inc -> mysql-test/include/set_binlog_format_row.sql mysql-test/include/set_binlog_format_statement.sql: Rename: mysql-test/include/set_binlog_format_statement.inc -> mysql-test/include/set_binlog_format_statement.sql mysql-test/lib/mtr_cases.pl: Reorganize code to - collect a suite - multiply the tests in the suite with any combinations the suite has - optimize the suite by skipping test not supported with current settings Use My::Config to read combinations file in my.cnf file format, this allowas a "short name" to be used for the combination instead of the full name wich is set to the extra arguments the combination applies Add function 'print_testcase' that can be used to print the testcases during different stages of the collect phase mysql-test/lib/mtr_report.pl: Print '' if combination is set mysql-test/mysql-test-run.pl: Add comments, fix indentation Rename .in to .sql files Only set binlog format dynamicall for master, slav is always restarted mysql-test/lib/My/Config.pm: New BitKeeper file ``mysql-test/lib/My/Config.pm'' mysql-test/suite/rpl/combinations: New BitKeeper file ``mysql-test/suite/rpl/combinations'' --- mysql-test/mysql-test-run.pl | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) (limited to 'mysql-test/mysql-test-run.pl') diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index e17bbeb251f..490eaabc37e 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -164,7 +164,7 @@ our $opt_bench= 0; our $opt_small_bench= 0; our $opt_big_test= 0; -our @opt_combination; +our @opt_combinations; our $opt_skip_combination; our @opt_extra_mysqld_opt; @@ -532,7 +532,7 @@ sub command_line_setup () { 'skip-im' => \$opt_skip_im, 'skip-test=s' => \$opt_skip_test, 'big-test' => \$opt_big_test, - 'combination=s' => \@opt_combination, + 'combination=s' => \@opt_combinations, 'skip-combination' => \$opt_skip_combination, # Specify ports @@ -928,6 +928,10 @@ sub command_line_setup () { mtr_error("Will not run in record mode without a specific test case"); } + if ( $opt_record ) + { + $opt_skip_combination = 1; + } # -------------------------------------------------------------------------- # ps protcol flag @@ -3330,24 +3334,26 @@ sub do_before_run_mysqltest($) # if script decided to run mysqltest cluster _is_ installed ok $ENV{'NDB_STATUS_OK'} = "YES"; } - if (defined $tinfo->{"binlog_format"} and $mysql_version_id > 50100 ) + if (defined $tinfo->{binlog_format} and $mysql_version_id > 50100 ) { - foreach my $server ((@$master,@$slave)) + # Dynamically switch binlog format of + # master, slave is always restarted + foreach my $server ( @$master ) { - if ($server->{'pid'}) - { - - mtr_init_args(\$args); + next unless ($server->{'pid'}); - mtr_add_arg($args, "--no-defaults"); - - mtr_add_arg($args, "--user=root"); - mtr_add_arg($args, "--port=$server->{'port'}"); - mtr_add_arg($args, "--socket=$server->{'path_sock'}"); - - mtr_run($exe_mysql, $args, "include/set_binlog_format_".$tinfo->{"binlog_format"}.".inc", "", "", ""); + mtr_init_args(\$args); + mtr_add_arg($args, "--no-defaults"); + mtr_add_arg($args, "--user=root"); + mtr_add_arg($args, "--port=$server->{'port'}"); + mtr_add_arg($args, "--socket=$server->{'path_sock'}"); - } + my $sql= "include/set_binlog_format_".$tinfo->{binlog_format}.".sql"; + mtr_verbose("Setting binlog format:", $tinfo->{binlog_format}); + if (mtr_run($exe_mysql, $args, $sql, "", "", "") != 0) + { + mtr_error("Failed to switch binlog format"); + } } } } @@ -5179,8 +5185,8 @@ Options to control what test suites or cases to run skip-im Don't start IM, and skip the IM test cases big-test Set the environment variable BIG_TEST, which can be checked from test cases. - combination="ARG1 .. ARG2" Specify a set of "mysqld" arguments for one - combination. + combination="ARG1 .. ARG2" Specify a set of "mysqld" arguments for one + combination. skip-combination Skip any combination options and combinations files Options that specify ports -- cgit v1.2.1 From ea9d91e82c5c02198cbaa2b52c6683b4ec191ee8 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Nov 2007 15:02:50 +0100 Subject: Move the "use lib" directive to mtr.pl --- mysql-test/mysql-test-run.pl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'mysql-test/mysql-test-run.pl') diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 490eaabc37e..5bbd45758b5 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -52,6 +52,9 @@ # "perl -d:Trace mysql-test-run.pl" # + +use lib "lib/"; + $Devel::Trace::TRACE= 0; # Don't trace boring init stuff #require 5.6.1; -- cgit v1.2.1 From 269b6f35bf303507a11a3259b4b4baee3919dfe4 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 23 Nov 2007 15:54:11 +0100 Subject: Apply patch for BUG#30630 --- mysql-test/mysql-test-run.pl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'mysql-test/mysql-test-run.pl') diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 5bbd45758b5..34a4cac55bf 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -3790,10 +3790,11 @@ sub mysqld_arguments ($$$$) { mtr_add_arg($args, "%s--connect-timeout=60", $prefix); # When mysqld is run by a root user(euid is 0), it will fail - # to start unless we specify what user to run as. If not running - # as root it will be ignored, see BUG#30630 - if (!(grep(/^--user/, @$extra_opt, @opt_extra_mysqld_opt))) { - mtr_add_arg($args, "%s--user=root"); + # to start unless we specify what user to run as, see BUG#30630 + my $euid= $>; + if (!$glob_win32 and $euid == 0 and + (grep(/^--user/, @$extra_opt, @opt_extra_mysqld_opt)) == 0) { + mtr_add_arg($args, "%s--user=root", $prefix); } if ( $opt_valgrind_mysqld ) -- cgit v1.2.1 From 80b33c48b172cb017d3c17504c10a3c1931c8b0b Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 27 Nov 2007 10:56:46 +0100 Subject: Increase the slave_net_timeout to double of what the master uses for connect_timeout --- mysql-test/mysql-test-run.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test/mysql-test-run.pl') diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 34a4cac55bf..c36fb3a3f40 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -3901,7 +3901,7 @@ sub mysqld_arguments ($$$$) { my $slave_load_path= "../tmp"; mtr_add_arg($args, "%s--slave-load-tmpdir=%s", $prefix, $slave_load_path); - mtr_add_arg($args, "%s--set-variable=slave_net_timeout=10", $prefix); + mtr_add_arg($args, "%s--set-variable=slave_net_timeout=120", $prefix); if ( @$slave_master_info ) { -- cgit v1.2.1