Commit cf747aa3 authored by unknown's avatar unknown
Browse files

Merge bk-internal:/home/bk/mysql-5.1-new-maint

into  shellback.(none):/home/msvensson/mysql/mysql-5.1-new-maint


mysql-test/mysql-test-run.pl:
  Auto merged
sql/handler.cc:
  Auto merged
parents 648f8a17 abc4c3dc
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -94,6 +94,8 @@ sub spawn_impl ($$$$$$$$) {
  my $pid_file=   shift;                 # FIXME
  my $spawn_opts= shift;

  mtr_error("Can't spawn with empty \"path\"") unless defined $path;

  if ( $::opt_script_debug )
  {
    print STDERR "\n";
+97 −68
Original line number Diff line number Diff line
@@ -216,7 +216,7 @@ our $opt_embedded_server;
our $opt_extern;
our $opt_fast;
our $opt_force;
our $opt_reorder;
our $opt_reorder= 1;
our $opt_enable_disabled;

our $opt_gcov;
@@ -360,6 +360,7 @@ sub install_db ($$);
sub run_testcase ($);
sub run_testcase_stop_servers ($$$);
sub run_testcase_start_servers ($);
sub run_testcase_check_skip_test($);
sub report_failure_and_restart ($);
sub do_before_start_master ($$);
sub do_before_start_slave ($$);
@@ -1954,6 +1955,23 @@ sub mysqld_wait_started($){
}


sub ndb_mgmd_wait_started($) {
  my ($cluster)= @_;

  my $retries= 100;
  while (ndbcluster_wait_started($cluster, "--no-contact") and
	 $retries)
  {
    # Millisceond sleep emulated with select
    select(undef, undef, undef, (0.1));

    $retries--;
  }

  return $retries == 0;

}

sub ndb_mgmd_start ($) {
  my $cluster= shift;

@@ -1974,13 +1992,12 @@ sub ndb_mgmd_start ($) {
		  "",
		  { append_log_file => 1 });


  # FIXME Should not be needed
  # Unfortunately the cluster nodes will fail to start
  # if ndb_mgmd has not started properly
  while (ndbcluster_wait_started($cluster, "--no-contact"))
  if (ndb_mgmd_wait_started($cluster))
  {
    select(undef, undef, undef, 0.1);
    mtr_error("Failed to wait for start of ndb_mgmd");
  }

  # Remember pid of ndb_mgmd
@@ -2045,7 +2062,7 @@ sub ndbcluster_start ($$) {
    mtr_error("Cluster '$cluster->{'name'}' already started");
  }

  my $pid= ndb_mgmd_start($cluster);
  ndb_mgmd_start($cluster);

  for ( my $idx= 0; $idx < $cluster->{'nodes'}; $idx++ )
  {
@@ -2156,6 +2173,11 @@ sub run_suite () {

  foreach my $tinfo ( @$tests )
  {
    if (run_testcase_check_skip_test($tinfo))
    {
      next;
    }

    mtr_timer_start($glob_timers,"testcase", 60 * $opt_testcase_timeout);
    run_testcase($tinfo);
    mtr_timer_stop($glob_timers,"testcase");
@@ -2440,32 +2462,9 @@ sub im_prepare_data_dir($) {
  }
}


##############################################################################
#
#  Run a single test case
#
##############################################################################

# When we get here, we have already filtered out test cases that doesn't
# apply to the current setup, for example if we use a running server, test
# cases that restart the server are dropped. So this function should mostly
# be about doing things, not a lot of logic.

# We don't start and kill the servers for each testcase. But some
# testcases needs a restart, because they specify options to start
# mysqld with. After that testcase, we need to restart again, to set
# back the normal options.

sub run_testcase ($) {
  my $tinfo=  shift;

  my $tname= $tinfo->{'name'};

  mtr_tonewfile($path_current_test_log,"$tname\n"); # Always tell where we are

  # output current test to ndbcluster log file to enable diagnostics
  mtr_tofile($file_ndb_testrun_log,"CURRENT TEST $tname\n");
sub run_testcase_check_skip_test($)
{
  my ($tinfo)= @_;

  # ----------------------------------------------------------------------
  # If marked to skip, just print out and return.
@@ -2478,7 +2477,7 @@ sub run_testcase ($) {
  {
    mtr_report_test_name($tinfo);
    mtr_report_test_skipped($tinfo);
    return;
    return 1;
  }

  # If test needs cluster, check that master installed ok
@@ -2486,7 +2485,7 @@ sub run_testcase ($) {
  {
    mtr_report_test_name($tinfo);
    mtr_report_test_failed($tinfo);
    return;
    return 1;
  }

  # If test needs slave cluster, check that it installed ok
@@ -2495,37 +2494,83 @@ sub run_testcase ($) {
  {
    mtr_report_test_name($tinfo);
    mtr_report_test_failed($tinfo);
    return;
    return 1;
  }

  my $master_restart= run_testcase_need_master_restart($tinfo);
  my $slave_restart= run_testcase_need_slave_restart($tinfo);
  return 0;
}

  if ($master_restart or $slave_restart)

sub do_before_run_mysqltest($)
{
    run_testcase_stop_servers($tinfo, $master_restart, $slave_restart);
  my $tinfo= shift;
  my $tname= $tinfo->{'name'};

  # Remove old reject file
  if ( $opt_suite eq "main" )
  {
    unlink("r/$tname.reject");
  }
  else
  {
    unlink("suite/$opt_suite/r/$tname.reject");
  }

  # ----------------------------------------------------------------------
  # Prepare to start masters. Even if we use embedded, we want to run
  # the preparation.
  # ----------------------------------------------------------------------

# MASV cleanup...
  mtr_tonewfile($path_current_test_log,"$tname\n"); # Always tell where we are

  # output current test to ndbcluster log file to enable diagnostics
  mtr_tofile($file_ndb_testrun_log,"CURRENT TEST $tname\n");

  mtr_tofile($master->[0]->{'path_myerr'},"CURRENT_TEST: $tname\n");
  if ( $master->[1]->{'pid'} )
  {
    mtr_tofile($master->[1]->{'path_myerr'},"CURRENT_TEST: $tname\n");
  }
}

  # ----------------------------------------------------------------------
  # If any mysqld servers running died, we have to know
  # ----------------------------------------------------------------------
sub do_after_run_mysqltest($)
{
  my $tinfo= shift;
  my $tname= $tinfo->{'name'};

  my $died= mtr_record_dead_children();
  #MASV cleanup
    # Save info from this testcase run to mysqltest.log
    my $testcase_log= mtr_fromfile($path_timefile) if -f $path_timefile;
    mtr_tofile($path_mysqltest_log,"CURRENT TEST $tname\n");
    mtr_tofile($path_mysqltest_log, $testcase_log);
  }

  # ----------------------------------------------------------------------
  # Start masters needed by the testcase
  # ----------------------------------------------------------------------

##############################################################################
#
#  Run a single test case
#
##############################################################################

# When we get here, we have already filtered out test cases that doesn't
# apply to the current setup, for example if we use a running server, test
# cases that restart the server are dropped. So this function should mostly
# be about doing things, not a lot of logic.

# We don't start and kill the servers for each testcase. But some
# testcases needs a restart, because they specify options to start
# mysqld with. After that testcase, we need to restart again, to set
# back the normal options.

sub run_testcase ($) {
  my $tinfo=  shift;

  my $master_restart= run_testcase_need_master_restart($tinfo);
  my $slave_restart= run_testcase_need_slave_restart($tinfo);

  if ($master_restart or $slave_restart)
  {
    run_testcase_stop_servers($tinfo, $master_restart, $slave_restart);
  }

  my $died= mtr_record_dead_children();
  if ($died or $master_restart or $slave_restart)
  {
    run_testcase_start_servers($tinfo);
@@ -2535,28 +2580,14 @@ sub run_testcase ($) {
  # If --start-and-exit or --start-dirty given, stop here to let user manually
  # run tests
  # ----------------------------------------------------------------------

  if ( $opt_start_and_exit or $opt_start_dirty )
  {
    mtr_report("\nServers started, exiting");
    exit(0);
  }

  # ----------------------------------------------------------------------
  # Run the test case
  # ----------------------------------------------------------------------

  {
    # remove the old reject file
    if ( $opt_suite eq "main" )
    {
      unlink("r/$tname.reject");
    }
    else
  {
      unlink("suite/$opt_suite/r/$tname.reject");
    }
    unlink($path_timefile);
    do_before_run_mysqltest($tinfo);

    my $res= run_mysqltest($tinfo);
    mtr_report_test_name($tinfo);
@@ -2592,10 +2623,8 @@ sub run_testcase ($) {

      report_failure_and_restart($tinfo);
    }
    # Save info from this testcase run to mysqltest.log
    my $testcase_log= mtr_fromfile($path_timefile) if -f $path_timefile;
    mtr_tofile($path_mysqltest_log,"CURRENT TEST $tname\n");
    mtr_tofile($path_mysqltest_log, $testcase_log);

    do_after_run_mysqltest($tinfo);
  }

  # ----------------------------------------------------------------------
+1 −1
Original line number Diff line number Diff line
@@ -3535,7 +3535,7 @@ int handler::ha_external_lock(THD *thd, int lock_type)
int handler::ha_reset()
{
  DBUG_ENTER("ha_reset");
  /* Check that we have called all proper delallocation functions */
  /* Check that we have called all proper deallocation functions */
  DBUG_ASSERT((byte*) table->def_read_set.bitmap +
              table->s->column_bitmap_size ==
              (byte*) table->def_write_set.bitmap);