Commit 71cc898e authored by unknown's avatar unknown

Merge pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-mtr-win

into  pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-mtr


mysql-test/lib/mtr_cases.pm:
  Auto merged
parents 348e26cf 579691a1
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <windows.h> #include <windows.h>
#include <stdio.h> #include <stdio.h>
#include <signal.h>
int main(int argc, const char** argv ) int main(int argc, const char** argv )
{ {
...@@ -30,6 +31,10 @@ int main(int argc, const char** argv ) ...@@ -30,6 +31,10 @@ int main(int argc, const char** argv )
HANDLE shutdown_event; HANDLE shutdown_event;
char safe_process_name[32]= {0}; char safe_process_name[32]= {0};
int retry_open_event= 100; int retry_open_event= 100;
/* Ignore any signals */
signal(SIGINT, SIG_IGN);
signal(SIGBREAK, SIG_IGN);
signal(SIGTERM, SIG_IGN);
if (argc != 2) { if (argc != 2) {
fprintf(stderr, "safe_kill <pid>\n"); fprintf(stderr, "safe_kill <pid>\n");
...@@ -37,31 +42,20 @@ int main(int argc, const char** argv ) ...@@ -37,31 +42,20 @@ int main(int argc, const char** argv )
} }
pid= atoi(argv[1]); pid= atoi(argv[1]);
_snprintf(safe_process_name, sizeof(safe_process_name), "safe_process[%d]", pid); _snprintf(safe_process_name, sizeof(safe_process_name),
"safe_process[%d]", pid);
/* Open the event to signal */ /* Open the event to signal */
while ((shutdown_event= while ((shutdown_event=
OpenEvent(EVENT_MODIFY_STATE, FALSE, safe_process_name)) == NULL) OpenEvent(EVENT_MODIFY_STATE, FALSE, safe_process_name)) == NULL)
{ {
fprintf(stderr, "Failed to open shutdown_event '%s', error: %d\n",
safe_process_name, GetLastError());
/* Just check to see if pid exists */
HANDLE pid_handle= OpenProcess(SYNCHRONIZE, FALSE, pid);
if (pid_handle == NULL)
fprintf(stderr, "Could not open process with pid %d, error: %d\n", pid);
else
CloseHandle(pid_handle);
if (retry_open_event--) if (retry_open_event--)
{ Sleep(0); /* yield */
fprintf(stderr, "retrying...\n");
Sleep(100); /* In milli seconds */
}
else else
{ {
fprintf(stderr, "No more retries, exiting"); fprintf(stderr, "Failed to open shutdown_event '%s', error: %d\n",
exit(1); safe_process_name, GetLastError());
exit(3);
} }
} }
...@@ -70,7 +64,7 @@ int main(int argc, const char** argv ) ...@@ -70,7 +64,7 @@ int main(int argc, const char** argv )
fprintf(stderr, "Failed to signal shutdown_event '%s', error: %d\n", fprintf(stderr, "Failed to signal shutdown_event '%s', error: %d\n",
safe_process_name, GetLastError()); safe_process_name, GetLastError());
CloseHandle(shutdown_event); CloseHandle(shutdown_event);
exit(1); exit(4);
} }
CloseHandle(shutdown_event); CloseHandle(shutdown_event);
exit(0); exit(0);
......
...@@ -820,7 +820,7 @@ sub collect_one_test_case { ...@@ -820,7 +820,7 @@ sub collect_one_test_case {
if ( $tinfo->{'ndb_test'} ) if ( $tinfo->{'ndb_test'} )
{ {
# This is a NDB test # This is a NDB test
if ( ! $::glob_ndbcluster_supported ) if ( $::opt_skip_ndbcluster == 2 )
{ {
# Ndb is not supported, skip it # Ndb is not supported, skip it
$tinfo->{'skip'}= 1; $tinfo->{'skip'}= 1;
...@@ -969,6 +969,7 @@ my @tags= ...@@ -969,6 +969,7 @@ my @tags=
["include/have_ndb_extra.inc", "ndb_extra", 1], ["include/have_ndb_extra.inc", "ndb_extra", 1],
["include/master-slave.inc", "rpl_test", 1], ["include/master-slave.inc", "rpl_test", 1],
["include/ndb_master-slave.inc", "rpl_test", 1], ["include/ndb_master-slave.inc", "rpl_test", 1],
["include/ndb_master-slave.inc", "ndb_test", 1],
["include/federated.inc", "federated_test", 1], ["include/federated.inc", "federated_test", 1],
["include/not_embedded.inc", "not_embedded", 1], ["include/not_embedded.inc", "not_embedded", 1],
); );
......
...@@ -181,8 +181,7 @@ our $opt_warnings= 1; ...@@ -181,8 +181,7 @@ our $opt_warnings= 1;
our $opt_skip_ndbcluster= 0; our $opt_skip_ndbcluster= 0;
our $opt_skip_ndbcluster_slave= 0; our $opt_skip_ndbcluster_slave= 0;
our $opt_with_ndbcluster= 0; our $opt_with_ndbcluster;
our $glob_ndbcluster_supported= 0;
our $opt_ndb_extra_test= 0; our $opt_ndb_extra_test= 0;
our $exe_ndb_mgm=""; our $exe_ndb_mgm="";
...@@ -1101,7 +1100,7 @@ sub environment_setup { ...@@ -1101,7 +1100,7 @@ sub environment_setup {
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
# Add the path where libndbclient can be found # Add the path where libndbclient can be found
# -------------------------------------------------------------------------- # --------------------------------------------------------------------------
if ( $glob_ndbcluster_supported ) if ( !$opt_skip_ndbcluster )
{ {
push(@ld_library_paths, "$basedir/storage/ndb/src/.libs"); push(@ld_library_paths, "$basedir/storage/ndb/src/.libs");
} }
...@@ -1549,28 +1548,20 @@ sub check_ndbcluster_support ($) { ...@@ -1549,28 +1548,20 @@ sub check_ndbcluster_support ($) {
if ($opt_skip_ndbcluster) if ($opt_skip_ndbcluster)
{ {
mtr_report(" - skipping ndbcluster"); mtr_report(" - skipping ndbcluster");
$opt_skip_ndbcluster_slave= 1; $opt_skip_ndbcluster_slave= $opt_skip_ndbcluster;
return; return;
} }
if ( ! $mysqld_variables{'ndb-connectstring'} ) if ( ! $mysqld_variables{'ndb-connectstring'} )
{ {
mtr_report(" - skipping ndbcluster, mysqld not compiled with ndbcluster"); mtr_report(" - skipping ndbcluster, mysqld not compiled with ndbcluster");
$opt_skip_ndbcluster= 1; $opt_skip_ndbcluster= 2;
$opt_skip_ndbcluster_slave= 1; $opt_skip_ndbcluster_slave= 2;
return; return;
} }
$glob_ndbcluster_supported= 1;
mtr_report(" - using ndbcluster when necessary, mysqld supports it"); mtr_report(" - using ndbcluster when necessary, mysqld supports it");
if ( $mysql_version_id < 50100 )
{
# Slave cluster is not supported until 5.1
$opt_skip_ndbcluster_slave= 1;
}
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment