List:Commits« Previous MessageNext Message »
From:msvensson Date:October 18 2006 1:24pm
Subject:bk commit into 4.1 tree (msvensson:1.2581)
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-10-18 13:24:06+02:00, msvensson@shellback.(none) +2 -0
  Make --with-ndbcluster only be valid together with --bench
  Improve code that detects if ndb shuold be installed
  Remove call to stop_all_servers after install db, if any servers are still running 
  and need to be stopped they will be stopped atuomatically

  mysql-test/lib/mtr_cases.pl@stripped, 2006-10-18 13:24:03+02:00, msvensson@shellback.(none)
+42 -39
    All tests that have "source include/have_ndb.inc" are ndb tests 

  mysql-test/mysql-test-run.pl@stripped, 2006-10-18 13:24:03+02:00,
msvensson@shellback.(none) +29 -21
    Set --with-ndbcluster to only be valid together with --bench
    Rename opt_ndbcluster_supported to glob_ndbcluster_supported it's not an option
    Fix warnings

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	msvensson
# Host:	shellback.(none)
# Root:	/home/msvensson/mysql/mysql-4.1-maint

--- 1.18/mysql-test/lib/mtr_cases.pl	2006-10-18 13:24:10 +02:00
+++ 1.19/mysql-test/lib/mtr_cases.pl	2006-10-18 13:24:10 +02:00
@@ -59,7 +59,9 @@
 
   if ( @::opt_cases )
   {
-    foreach my $tname ( @::opt_cases ) { # Run in specified order, no sort
+    foreach my $tname ( @::opt_cases )
+    {
+      # Run in specified order, no sort
       my $elem= undef;
       my $component_id= undef;
 
@@ -85,7 +87,7 @@
 
       # If target component is known, check that the specified test case
       # exists.
-      # 
+      #
       # Otherwise, try to guess the target component.
 
       if ( $component_id )
@@ -127,7 +129,8 @@
   }
   else
   {
-    foreach my $elem ( sort readdir(TESTDIR) ) {
+    foreach my $elem ( sort readdir(TESTDIR) )
+    {
       my $component_id= undef;
       my $tname= undef;
 
@@ -144,7 +147,9 @@
         next;
       }
 
-      next if $::opt_do_test and ! defined mtr_match_prefix($elem,$::opt_do_test);
+      # Skip tests that does not match the --do-test= filter
+      next if $::opt_do_test and
+	! defined mtr_match_prefix($elem,$::opt_do_test);
 
       collect_one_test_case($testdir,$resdir,$tname,$elem,$cases,\%disabled,
         $component_id);
@@ -152,7 +157,7 @@
     closedir TESTDIR;
   }
 
-  # Reorder the test cases in an order that wil make them faster to run
+  # Reorder the test cases in an order that will make them faster to run
   if ( $::opt_reorder )
   {
 
@@ -306,40 +311,6 @@
     $tinfo->{'slave_num'}= 1;
   }
 
-  if ( $::opt_with_ndbcluster or defined mtr_match_substring($tname,"ndb") )
-  {
-    # This is an ndb test or all tests should be run with ndb cluster started
-    $tinfo->{'ndb_test'}= 1;
-    if ( ! $::opt_ndbcluster_supported )
-    {
-      # Ndb is not supported, skip them
-      $tinfo->{'skip'}= 1;
-      $tinfo->{'comment'}= "No ndbcluster support";
-      return;
-    }
-    elsif ( $::opt_skip_ndbcluster )
-    {
-      # All ndb test's should be skipped
-      $tinfo->{'skip'}= 1;
-      $tinfo->{'comment'}= "No ndbcluster tests(--skip-ndbcluster)";
-      return;
-    }
-  }
-  else
-  {
-    # This is not a ndb test
-    $tinfo->{'ndb_test'}= 0;
-    if ( $::opt_with_ndbcluster_only )
-    {
-      # Only the ndb test should be run, all other should be skipped
-      $tinfo->{'skip'}= 1;
-      $tinfo->{'comment'}= "Only ndbcluster tests(--with-ndbcluster-only)";
-      return;
-    }
-  }
-
-  # FIXME what about embedded_server + ndbcluster, skip ?!
-
   my $master_opt_file= "$testdir/$tname-master.opt";
   my $slave_opt_file=  "$testdir/$tname-slave.opt";
   my $slave_mi_file=   "$testdir/$tname.slave-mi";
@@ -550,6 +521,37 @@
       $tinfo->{'comment'}= "Test need debug binaries";
       return;
     }
+
+    if ( $tinfo->{'ndb_test'} )
+    {
+      # This is a NDB test
+      if ( ! $::glob_ndbcluster_supported )
+      {
+	# Ndb is not supported, skip it
+	$tinfo->{'skip'}= 1;
+	$tinfo->{'comment'}= "No ndbcluster support";
+	return;
+      }
+      elsif ( $::opt_skip_ndbcluster )
+      {
+	# All ndb test's should be skipped
+	$tinfo->{'skip'}= 1;
+	$tinfo->{'comment'}= "No ndbcluster tests(--skip-ndbcluster)";
+	return;
+      }
+    }
+    else
+    {
+      # This is not a ndb test
+      if ( $::opt_with_ndbcluster_only )
+      {
+	# Only the ndb test should be run, all other should be skipped
+	$tinfo->{'skip'}= 1;
+	$tinfo->{'comment'}= "Only ndbcluster tests(--with-ndbcluster-only)";
+	return;
+      }
+    }
+
   }
 }
 
@@ -563,6 +565,7 @@
  ["include/have_binlog_format_statement.inc", "binlog_format", "stmt"],
  ["include/big_test.inc", "big_test", 1],
  ["include/have_debug.inc", "need_debug", 1],
+ ["include/have_ndb.inc", "ndb_test", 1],
  ["include/have_ndb_extra.inc", "ndb_extra", 1],
  ["require_manager", "require_manager", 1],
 );

--- 1.118/mysql-test/mysql-test-run.pl	2006-10-18 13:24:10 +02:00
+++ 1.119/mysql-test/mysql-test-run.pl	2006-10-18 13:24:10 +02:00
@@ -65,6 +65,7 @@
 use IO::Socket::INET;
 use Data::Dumper;
 use strict;
+use warnings;
 use diagnostics;
 
 our $glob_win32_perl=  ($^O eq "MSWin32"); # ActiveState Win32 Perl
@@ -277,7 +278,7 @@
 our $opt_skip_ndbcluster_slave= 0;
 our $opt_with_ndbcluster= 0;
 our $opt_with_ndbcluster_only= 0;
-our $opt_ndbcluster_supported= 0;
+our $glob_ndbcluster_supported= 0;
 our $opt_ndb_extra_test= 0;
 our $opt_skip_master_binlog= 0;
 our $opt_skip_slave_binlog= 0;
@@ -572,10 +573,10 @@
              'compress'                 => \$opt_compress,
              'bench'                    => \$opt_bench,
              'small-bench'              => \$opt_small_bench,
+             'with-ndbcluster'          => \$opt_with_ndbcluster,
 
              # Control what test suites or cases to run
              'force'                    => \$opt_force,
-             'with-ndbcluster'          => \$opt_with_ndbcluster,
              'with-ndbcluster-only'     => \$opt_with_ndbcluster_only,
              'skip-ndbcluster|skip-ndb' => \$opt_skip_ndbcluster,
              'skip-ndbcluster-slave|skip-ndb-slave'
@@ -846,9 +847,9 @@
   # --------------------------------------------------------------------------
   # Ndb cluster flags
   # --------------------------------------------------------------------------
-  if ( $opt_with_ndbcluster and $opt_skip_ndbcluster)
+  if ( $opt_with_ndbcluster and !$opt_bench)
   {
-    mtr_error("Can't specify both --with-ndbcluster and --skip-ndbcluster");
+    mtr_error("Can only use --with-ndbcluster togheter with --bench");
   }
 
   if ( $opt_ndbconnectstring )
@@ -1485,7 +1486,7 @@
  # --------------------------------------------------------------------------
   # Add the path where libndbclient can be found
   # --------------------------------------------------------------------------
-  if ( $opt_ndbcluster_supported )
+  if ( $glob_ndbcluster_supported )
   {
     push(@ld_library_paths,  "$glob_basedir/storage/ndb/src/.libs");
   }
@@ -1870,6 +1871,8 @@
 	rmtree(readlink($opt_vardir));
 	# Remove the entire "var" dir
 	rmtree("$opt_vardir/");
+	# Remove the "var" symlink
+	unlink($opt_vardir);
       }
       else
       {
@@ -2042,7 +2045,7 @@
     $opt_skip_ndbcluster_slave= 1;
     return;
   }
-  $opt_ndbcluster_supported= 1;
+  $glob_ndbcluster_supported= 1;
   mtr_report("Using ndbcluster when necessary, mysqld supports it");
 
   if ( $mysql_version_id < 50100 )
@@ -2059,11 +2062,6 @@
 sub ndbcluster_start_install ($) {
   my $cluster= shift;
 
-  if ( $opt_skip_ndbcluster or $glob_use_running_ndbcluster )
-  {
-    return 0;
-  }
-
   mtr_report("Installing $cluster->{'name'} Cluster");
 
   mkdir($cluster->{'data_dir'});
@@ -2477,11 +2475,24 @@
 
   my $cluster_started_ok= 1; # Assume it can be started
 
-  if (ndbcluster_start_install($clusters->[0]) ||
-      ($max_slave_num && !$opt_skip_ndbcluster_slave &&
-       ndbcluster_start_install($clusters->[1])))
+  if ($opt_skip_ndbcluster || $glob_use_running_ndbcluster)
+  {
+    # Don't install master cluster
+  }
+  elsif (ndbcluster_start_install($clusters->[0]))
+  {
+    mtr_warning("Failed to start install of $clusters->[0]->{name}");
+    $cluster_started_ok= 0;
+  }
+
+  if ($max_slave_num == 0 ||
+      $opt_skip_ndbcluster_slave || $glob_use_running_ndbcluster_slave)
   {
-    mtr_warning("Failed to start install of cluster");
+    # Don't install slave cluster
+  }
+  elsif (ndbcluster_start_install($clusters->[1]))
+  {
+    mtr_warning("Failed to start install of $clusters->[1]->{name}");
     $cluster_started_ok= 0;
   }
 
@@ -2514,9 +2525,6 @@
     }
   }
 
-  # Stop clusters...
-  stop_all_servers();
-
   return 0;
 }
 
@@ -3592,14 +3600,14 @@
     mtr_verbose("Restart master: Restart forced with --force-restart");
   }
   elsif ( ! $opt_skip_ndbcluster and
-	  $tinfo->{'ndb_test'} == 0 and
+	  !$tinfo->{'ndb_test'} and
 	  $clusters->[0]->{'pid'} != 0 )
   {
     $do_restart= 1;           # Restart without cluster
     mtr_verbose("Restart master: Test does not need cluster");
   }
   elsif ( ! $opt_skip_ndbcluster and
-	  $tinfo->{'ndb_test'} == 1 and
+	  $tinfo->{'ndb_test'} and
 	  $clusters->[0]->{'pid'} == 0 )
   {
     $do_restart= 1;           # Restart with cluster
@@ -4455,6 +4463,7 @@
   skip-ssl              Dont start server with support for ssl connections
   bench                 Run the benchmark suite
   small-bench           Run the benchmarks with --small-tests --small-tables
+  with-ndbcluster       Use cluster as default table type for benchmark
 
 Options to control directories to use
   benchdir=DIR          The directory where the benchmark suite is stored
@@ -4471,7 +4480,6 @@
 Options to control what test suites or cases to run
 
   force                 Continue to run the suite after failure
-  with-ndbcluster       Use cluster in all tests
   with-ndbcluster-only  Run only tests that include "ndb" in the filename
   skip-ndb[cluster]     Skip all tests that need cluster
   skip-ndb[cluster]-slave Skip all tests that need a slave cluster
Thread
bk commit into 4.1 tree (msvensson:1.2581)msvensson18 Oct