summaryrefslogtreecommitdiff
path: root/mysql-test/mysql-test-run.pl
diff options
context:
space:
mode:
authorunknown <magnus.blaudd@oracle.com>2012-11-04 22:11:34 +0100
committerunknown <magnus.blaudd@oracle.com>2012-11-04 22:11:34 +0100
commit574b107a5704575d0353ac2771286be97a0ff597 (patch)
treeab7b8fe4f434a63aecf9e19e5b9dfd557112bdbd /mysql-test/mysql-test-run.pl
parent20ca730f5616c15935d0af7a0b48b29ee9124541 (diff)
downloadmariadb-git-574b107a5704575d0353ac2771286be97a0ff597.tar.gz
mtr.pl
- improve the logic that decides when ndbcluster should be enabled and the extra test suites for MySQL Cluster should be added. Should be consistent and logical now ;)
Diffstat (limited to 'mysql-test/mysql-test-run.pl')
-rwxr-xr-xmysql-test/mysql-test-run.pl104
1 files changed, 77 insertions, 27 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index a9add9be394..25c741cb821 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -310,8 +310,9 @@ sub check_timeout ($) { return testcase_timeout($_[0]) / 10; }
our $opt_warnings= 1;
-our $opt_include_ndbcluster= 0;
-our $opt_skip_ndbcluster= 1;
+our $ndbcluster_enabled= 0;
+my $opt_include_ndbcluster= 0;
+my $opt_skip_ndbcluster= 0;
my $exe_ndbd;
my $exe_ndbmtd;
@@ -1070,7 +1071,7 @@ sub command_line_setup {
# Control what test suites or cases to run
'force' => \$opt_force,
'with-ndbcluster-only' => \&collect_option,
- 'include-ndbcluster' => \$opt_include_ndbcluster,
+ 'ndb|include-ndbcluster' => \$opt_include_ndbcluster,
'skip-ndbcluster|skip-ndb' => \$opt_skip_ndbcluster,
'suite|suites=s' => \$opt_suites,
'skip-rpl' => \&collect_option,
@@ -1519,7 +1520,6 @@ sub command_line_setup {
}
$ENV{'PATH'}= "$ENV{'PATH'}".$separator.$lib_mysqld;
}
- $opt_skip_ndbcluster= 1; # Turn off use of NDB cluster
$opt_skip_ssl= 1; # Turn off use of SSL
# Turn off use of bin log
@@ -1999,7 +1999,7 @@ sub executable_setup () {
$exe_mysql_embedded= mtr_exe_maybe_exists("$basedir/libmysqld/examples/mysql_embedded");
- if ( ! $opt_skip_ndbcluster )
+ if ( $ndbcluster_enabled )
{
# Look for single threaded NDB
$exe_ndbd=
@@ -2270,7 +2270,7 @@ sub environment_setup {
# --------------------------------------------------------------------------
# Add the path where libndbclient can be found
# --------------------------------------------------------------------------
- if ( !$opt_skip_ndbcluster )
+ if ( $ndbcluster_enabled )
{
push(@ld_library_paths, "$basedir/storage/ndb/src/.libs");
}
@@ -2358,7 +2358,7 @@ sub environment_setup {
# ----------------------------------------------------
# Setup env for NDB
# ----------------------------------------------------
- if ( ! $opt_skip_ndbcluster )
+ if ( $ndbcluster_enabled )
{
$ENV{'NDB_MGM'}=
my_find_bin($bindir,
@@ -2753,37 +2753,87 @@ sub vs_config_dirs ($$) {
sub check_ndbcluster_support ($) {
my $mysqld_variables= shift;
- # Check if this is MySQL Cluster, ie. mysql version string ends
- # with -ndb-Y.Y.Y[-status]
- if ( defined $mysql_version_extra &&
- $mysql_version_extra =~ /^-ndb-/ )
+ my $ndbcluster_supported = 0;
+ if ($mysqld_variables{'ndb-connectstring'})
{
- mtr_report(" - MySQL Cluster");
- # Enable ndb engine and add more test suites
- $opt_include_ndbcluster = 1;
- $DEFAULT_SUITES.=",ndb";
+ $ndbcluster_supported = 1;
}
- if ($opt_include_ndbcluster)
+ if ($opt_skip_ndbcluster && $opt_include_ndbcluster)
{
- $opt_skip_ndbcluster= 0;
+ # User is ambivalent. Theoretically the arg which was
+ # given last on command line should win, but that order is
+ # unknown at this time.
+ mtr_error("Ambigous command, both --include-ndbcluster " .
+ " and --skip-ndbcluster was specified");
}
- if ($opt_skip_ndbcluster)
+ # Check if this is MySQL Cluster, ie. mysql version string ends
+ # with -ndb-Y.Y.Y[-status]
+ if ( defined $mysql_version_extra &&
+ $mysql_version_extra =~ /-ndb-([0-9]*)\.([0-9]*)\.([0-9]*)/ )
{
- mtr_report(" - skipping ndbcluster");
- return;
- }
+ # MySQL Cluster tree
+ mtr_report(" - MySQL Cluster detected");
- if ( ! $mysqld_variables{'ndb-connectstring'} )
- {
- mtr_report(" - skipping ndbcluster, mysqld not compiled with ndbcluster");
- $opt_skip_ndbcluster= 2;
- return;
+ if ($opt_skip_ndbcluster)
+ {
+ mtr_report(" - skipping ndbcluster(--skip-ndbcluster)");
+ return;
+ }
+
+ if (!$ndbcluster_supported)
+ {
+ # MySQL Cluster tree, but mysqld was not compiled with
+ # ndbcluster -> fail unless --skip-ndbcluster was used
+ mtr_error("This is MySQL Cluster but mysqld does not " .
+ "support ndbcluster. Use --skip-ndbcluster to " .
+ "force mtr to run without it.");
+ }
+
+ # mysqld was compiled with ndbcluster -> auto enable
}
+ else
+ {
+ # Not a MySQL Cluster tree
+ if (!$ndbcluster_supported)
+ {
+ if ($opt_include_ndbcluster)
+ {
+ mtr_error("Could not detect ndbcluster support ".
+ "requested with --include-ndbcluster");
+ }
+
+ # Silently skip, mysqld was compiled without ndbcluster
+ # which is the default case
+ return;
+ }
+
+ if ($opt_skip_ndbcluster)
+ {
+ # Compiled with ndbcluster but ndbcluster skipped
+ mtr_report(" - skipping ndbcluster(--skip-ndbcluster)");
+ return;
+ }
+
- mtr_report(" - using ndbcluster when necessary, mysqld supports it");
+ # Not a MySQL Cluster tree, enable ndbcluster
+ # if --include-ndbcluster was used
+ if ($opt_include_ndbcluster)
+ {
+ # enable ndbcluster
+ }
+ else
+ {
+ mtr_report(" - skipping ndbcluster(disabled by default)");
+ return;
+ }
+ }
+ mtr_report(" - enabling ndbcluster");
+ $ndbcluster_enabled= 1;
+ # Add MySQL Cluster test suites
+ $DEFAULT_SUITES.=",ndb,ndb_binlog,rpl_ndb,ndb_rpl,ndb_memcache";
return;
}