Commit b36295dd authored by dkatz@damien-katzs-computer.local's avatar dkatz@damien-katzs-computer.local
Browse files

Merge dkatz@bk-internal.mysql.com:/home/bk/mysql-5.0-maint

into  damien-katzs-computer.local:/Users/dkatz/mysql50
parents a38a3c55 ba63d79e
Loading
Loading
Loading
Loading
+19 −14
Original line number Diff line number Diff line
@@ -142,6 +142,7 @@ sub spawn_impl ($$$$$$$) {

    if ( $pid )
    {
      select(STDOUT) if $::glob_win32_perl;
      return spawn_parent_impl($pid,$mode,$path);
    }
    else
@@ -163,9 +164,6 @@ sub spawn_impl ($$$$$$$) {
	{
	  # Don't redirect stdout on ActiveState perl since this is
          # just another thread in the same process.
          # Should be fixed so that the thread that is created with fork
          # executes the exe in another process and wait's for it to return.
          # In the meanwhile, we get all the output from mysqld's to screen
	}
        elsif ( ! open(STDOUT,$log_file_open_mode,$output) )
        {
@@ -175,7 +173,7 @@ sub spawn_impl ($$$$$$$) {

      if ( $error )
      {
        if ( $output eq $error )
        if ( !$::glob_win32_perl and $output eq $error )
        {
          if ( ! open(STDERR,">&STDOUT") )
          {
@@ -184,15 +182,7 @@ sub spawn_impl ($$$$$$$) {
        }
        else
        {
	  if ( $::glob_win32_perl )
	  {
	    # Don't redirect stdout on ActiveState perl since this is
	    # just another thread in the same process.
	    # Should be fixed so that the thread that is created with fork
	    # executes the exe in another process and wait's for it to return.
	    # In the meanwhile, we get all the output from mysqld's to screen
	  }
          elsif ( ! open(STDERR,$log_file_open_mode,$error) )
          if ( ! open(STDERR,$log_file_open_mode,$error) )
          {
            mtr_child_error("can't redirect STDERR to \"$error\": $!");
          }
@@ -611,6 +601,11 @@ sub mtr_check_stop_servers ($) {
    if ( $pid )
    {
      # Server is still alive, put it in list to be hard killed
      if ($::glob_win32_perl)
      {
	# Kill the real process if it's known
	$pid= $srv->{'real_pid'} if ($srv->{'real_pid'});
      }
      $kill_pids{$pid}= 1;

      # Write a message to the process's error log (if it has one)
@@ -664,6 +659,16 @@ sub mtr_check_stop_servers ($) {
	  }
	}

	if ($::glob_win32_perl and $srv->{'real_pid'})
	{
	  # Wait for the pseudo pid - if the real_pid was known
	  # the pseudo pid has not been waited for yet, wai blocking
	  # since it's "such a simple program"
	  mtr_verbose("Wait for pseudo process $srv->{'pid'}");
	  my $ret_pid= waitpid($srv->{'pid'}, 0);
	  mtr_verbose("Pseudo process $ret_pid died");
	}

	$srv->{'pid'}= 0;
      }
    }
@@ -1041,7 +1046,7 @@ sub sleep_until_file_created ($$$) {
  {
    if ( -r $pidfile )
    {
      return $pid;
      return 1;
    }

    # Check if it died after the fork() was successful
+7 −2
Original line number Diff line number Diff line
@@ -97,9 +97,14 @@ sub mtr_timer_start($$$) {
      # clearing the signal handler.
      $SIG{INT}= 'DEFAULT';

      $SIG{TERM}= sub {
	mtr_verbose("timer woke up, exiting!");
	exit(0);
      };

      $0= "mtr_timer(timers,$name,$duration)";
      mtr_verbose("timer child $name, sleep $duration");
      sleep($duration);
      mtr_verbose("timer expired after $duration seconds");
      exit(0);
    }
  }
@@ -118,7 +123,7 @@ sub mtr_timer_stop ($$) {

    # FIXME as Cygwin reuses pids fast, maybe check that is
    # the expected process somehow?!
    kill(9, $tpid);
    kill(15, $tpid);

    # As the timers are so simple programs, we trust them to terminate,
    # and use blocking wait for it. We wait just to avoid a zombie.
+18 −9
Original line number Diff line number Diff line
@@ -2579,10 +2579,19 @@ sub ndbcluster_wait_started($$){
sub mysqld_wait_started($){
  my $mysqld= shift;

  my $res= sleep_until_file_created($mysqld->{'path_pid'},
  if (sleep_until_file_created($mysqld->{'path_pid'},
			       $mysqld->{'start_timeout'},
				    $mysqld->{'pid'});
  return $res == 0;
			       $mysqld->{'pid'}) == 0)
  {
    # Failed to wait for pid file
    return 1;
  }

  # Get the "real pid" of the process, it will be used for killing
  # the process in ActiveState's perl on windows
  $mysqld->{'real_pid'}= mtr_get_pid_from_file($mysqld->{'path_pid'});

  return 0;
}


@@ -3720,7 +3729,6 @@ sub mysqld_arguments ($$$$) {

  mtr_add_arg($args, "%s--no-defaults", $prefix);

  mtr_add_arg($args, "%s--console", $prefix);
  mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir);
  mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);

@@ -4093,6 +4101,7 @@ sub stop_all_servers () {

      push(@kill_pids,{
		       pid      => $mysqld->{'pid'},
		       real_pid => $mysqld->{'real_pid'},
		       pidfile  => $mysqld->{'path_pid'},
		       sockfile => $mysqld->{'path_sock'},
		       port     => $mysqld->{'port'},
@@ -4300,6 +4309,7 @@ sub run_testcase_stop_servers($$$) {

	push(@kill_pids,{
			 pid      => $mysqld->{'pid'},
			 real_pid => $mysqld->{'real_pid'},
			 pidfile  => $mysqld->{'path_pid'},
			 sockfile => $mysqld->{'path_sock'},
			 port     => $mysqld->{'port'},
@@ -4351,6 +4361,7 @@ sub run_testcase_stop_servers($$$) {

	push(@kill_pids,{
			 pid      => $mysqld->{'pid'},
			 real_pid => $mysqld->{'real_pid'},
			 pidfile  => $mysqld->{'path_pid'},
			 sockfile => $mysqld->{'path_sock'},
			 port     => $mysqld->{'port'},
@@ -4775,12 +4786,10 @@ sub run_mysqltest ($) {
    mtr_add_arg($args, "%s", $_) for @args_saved;
  }

  mtr_add_arg($args, "--test-file");
  mtr_add_arg($args, $tinfo->{'path'});
  mtr_add_arg($args, "--test-file=%s", $tinfo->{'path'});

  if ( defined $tinfo->{'result_file'} ) {
    mtr_add_arg($args, "--result-file");
    mtr_add_arg($args, $tinfo->{'result_file'});
    mtr_add_arg($args, "--result-file=%s", $tinfo->{'result_file'});
  }

  if ( $opt_record )
+2 −0
Original line number Diff line number Diff line
mysqld is alive
End of 5.0 tests.
+1 −0
Original line number Diff line number Diff line
--skip-grant-tables --loose-shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --loose-shared-memory=1
Loading