From 8834fda51be77118fb6393f34b0d4a9795fa6298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20Bl=C3=A5udd?= Date: Wed, 19 Jan 2011 15:47:56 +0100 Subject: [PATCH] Cherry pick fix fo detecting MySQL CLuster in mtr.pl --- mysql-test/mysql-test-run.pl | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 1eac4cc0527..4de08339866 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -108,6 +108,7 @@ require "lib/mtr_misc.pl"; $SIG{INT}= sub { mtr_error("Got ^C signal"); }; our $mysql_version_id; +my $mysql_version_extra; our $glob_mysql_test_dir; our $basedir; our $bindir; @@ -1667,12 +1668,13 @@ sub collect_mysqld_features { # Look for version my $exe_name= basename($exe_mysqld); mtr_verbose("exe_name: $exe_name"); - if ( $line =~ /^\S*$exe_name\s\sVer\s([0-9]*)\.([0-9]*)\.([0-9]*)/ ) + if ( $line =~ /^\S*$exe_name\s\sVer\s([0-9]*)\.([0-9]*)\.([0-9]*)([^\s]*)/ ) { #print "Major: $1 Minor: $2 Build: $3\n"; $mysql_version_id= $1*10000 + $2*100 + $3; #print "mysql_version_id: $mysql_version_id\n"; mtr_report("MySQL Version $1.$2.$3"); + $mysql_version_extra= $4; } } else @@ -1757,12 +1759,13 @@ sub collect_mysqld_features_from_running_server () # Parse version my $version_str= $mysqld_variables{'version'}; - if ( $version_str =~ /^([0-9]*)\.([0-9]*)\.([0-9]*)/ ) + if ( $version_str =~ /^([0-9]*)\.([0-9]*)\.([0-9]*)([^\s]*)/ ) { #print "Major: $1 Minor: $2 Build: $3\n"; $mysql_version_id= $1*10000 + $2*100 + $3; #print "mysql_version_id: $mysql_version_id\n"; mtr_report("MySQL Version $1.$2.$3"); + $mysql_version_extra= $4; } mtr_error("Could not find version of MySQL") unless $mysql_version_id; } @@ -2538,6 +2541,17 @@ 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-/ ) + { + mtr_report(" - MySQL Cluster"); + # Enable ndb engine and add more test suites + $opt_include_ndbcluster = 1; + $DEFAULT_SUITES.=",ndb"; + } + if ($opt_include_ndbcluster) { $opt_skip_ndbcluster= 0;