diff options
-rw-r--r-- | mysql-test/include/mtr_check.sql | 10 | ||||
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 26 |
2 files changed, 35 insertions, 1 deletions
diff --git a/mysql-test/include/mtr_check.sql b/mysql-test/include/mtr_check.sql index 12cb2c870a2..9db631a2615 100644 --- a/mysql-test/include/mtr_check.sql +++ b/mysql-test/include/mtr_check.sql @@ -57,3 +57,13 @@ BEGIN mysql.user; END|| + +-- +-- Procedure used by test case used to force all +-- servers to restart after testcase and thus skipping +-- check test case after test +-- +CREATE DEFINER=root@localhost PROCEDURE force_restart() +BEGIN + SELECT 1 INTO OUTFILE 'force_restart'; +END|| diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 0cd8b9a703d..94e865ad5c8 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -3126,6 +3126,26 @@ sub find_analyze_request } +# The test can leave a file in var/tmp/ to signal +# that all servers should be restarted +sub restart_forced_by_test +{ + my $restart = 0; + foreach my $mysqld ( mysqlds() ) + { + my $datadir = $mysqld->value('datadir'); + my $force_restart_file = "$datadir/mtr/force_restart"; + if ( -f $force_restart_file ) + { + mtr_verbose("Restart of servers forced by test"); + $restart = 1; + last; + } + } + return $restart; +} + + # Return timezone value of tinfo or default value sub timezone { my ($tinfo)= @_; @@ -3294,7 +3314,11 @@ sub run_testcase ($) { if ( $res == 0 ) { my $check_res; - if ( $opt_check_testcases and + if ( restart_forced_by_test() ) + { + stop_all_servers(); + } + elsif ( $opt_check_testcases and $check_res= check_testcase($tinfo, "after")) { if ($check_res == 1) { |