Browse Source

Make have_ndb.in portable

mysql-test/include/have_ndb.inc:
  Remove the "exec test" and instead use the portable way to
  check an environment variable using "eval select". The value of 
  $NDB_STATUS_OK will this be replace by mysqltest and the query 
  "select "YES" and ndb_status_ok" will be sent to the server and back.
mysql-test/mysql-test-run.pl:
  Move initializetion of NDB_STATUS_OK and only do it once in init part of scripot. This will make it possible to  set 
  it to NO if we detect that cluster can't be started.
pull/374/head
unknown 20 years ago
parent
commit
48757ce3c2
  1. 9
      mysql-test/include/have_ndb.inc
  2. 5
      mysql-test/mysql-test-run.pl

9
mysql-test/include/have_ndb.inc

@ -1,6 +1,13 @@
--exec test x$NDB_STATUS_OK = x1
# Check that server is compiled and started with support for NDB
-- require r/have_ndb.require
disable_query_log;
show variables like "have_ndbcluster";
enable_query_log;
# Check that NDB is installed and known to be working
-- require r/have_ndb_status_ok.require
disable_query_log;
eval select "$NDB_STATUS_OK" as ndb_status_ok;
enable_query_log;

5
mysql-test/mysql-test-run.pl

@ -1175,6 +1175,7 @@ sub environment_setup () {
$ENV{'MYSQL_TCP_PORT'}= 3306;
$ENV{'NDBCLUSTER_PORT'}= $opt_ndbcluster_port;
$ENV{'NDB_STATUS_OK'}= "YES";
$ENV{'IM_PATH_PID'}= $instance_manager->{path_pid};
$ENV{'IM_PORT'}= $instance_manager->{port};
@ -1661,6 +1662,7 @@ sub mysql_install_db () {
mtr_report("ndbcluster_install failed, continuing without cluster");
$opt_with_ndbcluster= 0;
$flag_ndb_status_ok= 0;
$ENV{'NDB_STATUS_OK'}= "NO";
}
else
{
@ -1682,7 +1684,7 @@ sub install_db ($$) {
my $init_db_sql_tmp= "/tmp/init_db.sql$$";
my $args;
mtr_report("Installing \u$type Databases");
mtr_report("Installing \u$type Database");
open(IN, $init_db_sql)
or mtr_error("Can't open $init_db_sql: $!");
@ -2935,7 +2937,6 @@ sub run_mysqltest ($) {
$ENV{'CHARSETSDIR'}= $path_charsetsdir;
$ENV{'MYSQL_MY_PRINT_DEFAULTS'}= $exe_my_print_defaults;
$ENV{'NDB_STATUS_OK'}= $flag_ndb_status_ok;
$ENV{'NDB_MGM'}= $exe_ndb_mgm;
$ENV{'NDB_BACKUP_DIR'}= $path_ndb_data_dir;
$ENV{'NDB_DATA_DIR'}= $path_ndb_data_dir;

Loading…
Cancel
Save