From fc7fea0cc3cec375a3e83339ca993360ca5aafec Mon Sep 17 00:00:00 2001 From: "tsmith@quadxeon.mysql.com" <> Date: Tue, 1 May 2007 20:05:09 +0200 Subject: [PATCH] mysql-test-run.pl: Run master init scripts also for --embedded-server --- mysql-test/mysql-test-run.pl | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 9ba1a1de31a..2de7c507dc3 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -3434,6 +3434,10 @@ sub run_testcase ($) { return 1; } } + elsif ($glob_use_embedded_server) + { + run_master_init_script($tinfo); + } # ---------------------------------------------------------------------- # If --start-and-exit or --start-dirty given, stop here to let user manually @@ -3609,6 +3613,23 @@ sub report_failure_and_restart ($) { } +sub run_master_init_script ($) { + my ($tinfo)= @_; + my $init_script= $tinfo->{'master_sh'}; + + # Run master initialization shell script if one exists + if ( $init_script ) + { + my $ret= mtr_run("/bin/sh", [$init_script], "", "", "", ""); + if ( $ret != 0 ) + { + # FIXME rewrite those scripts to return 0 if successful + # mtr_warning("$init_script exited with code $ret"); + } + } +} + + ############################################################################## # # Start and stop servers @@ -3620,7 +3641,6 @@ sub do_before_start_master ($) { my ($tinfo)= @_; my $tname= $tinfo->{'name'}; - my $init_script= $tinfo->{'master_sh'}; # FIXME what about second master..... @@ -3636,16 +3656,7 @@ sub do_before_start_master ($) { unlink("$master->[1]->{'path_myddir'}/master.info"); unlink("$master->[1]->{'path_myddir'}/relay-log.info"); - # Run master initialization shell script if one exists - if ( $init_script ) - { - my $ret= mtr_run("/bin/sh", [$init_script], "", "", "", ""); - if ( $ret != 0 ) - { - # FIXME rewrite those scripts to return 0 if successful - # mtr_warning("$init_script exited with code $ret"); - } - } + run_master_init_script($tinfo); }