summaryrefslogtreecommitdiff
path: root/mysql-test/lib
diff options
context:
space:
mode:
authorunknown <msvensson@pilot.blaudden>2007-04-02 10:50:39 +0200
committerunknown <msvensson@pilot.blaudden>2007-04-02 10:50:39 +0200
commit7d4fbd3d3f54db4eecbb098acc18d69c34e77bae (patch)
treeda9c4b945967d94e3b16c2fd56a52699aba69b66 /mysql-test/lib
parentc385fdf72005f66caf54a0998dfff4def2f074d3 (diff)
parenta840a68462d312b2fe24c805881346024a6dabcd (diff)
downloadmariadb-git-7d4fbd3d3f54db4eecbb098acc18d69c34e77bae.tar.gz
Merge pilot.blaudden:/home/msvensson/mysql/mysql-5.0
into pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint mysql-test/mysql-test-run.pl: Auto merged mysql-test/r/create.result: Auto merged mysql-test/r/type_datetime.result: Auto merged sql/field.h: Auto merged sql/item.h: Auto merged sql/item_func.cc: Auto merged sql/item_strfunc.cc: Auto merged sql/item_sum.cc: Auto merged sql/sql_yacc.yy: Auto merged mysql-test/r/gis.result: SCCS merged mysql-test/t/gis.test: SCCS merged
Diffstat (limited to 'mysql-test/lib')
-rw-r--r--mysql-test/lib/mtr_cases.pl11
-rw-r--r--mysql-test/lib/mtr_process.pl45
2 files changed, 30 insertions, 26 deletions
diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl
index 22290a88d39..28c78fbffeb 100644
--- a/mysql-test/lib/mtr_cases.pl
+++ b/mysql-test/lib/mtr_cases.pl
@@ -498,6 +498,17 @@ sub collect_one_test_case($$$$$$$) {
{
mtr_options_from_test_file($tinfo,"$testdir/${tname}.test");
+ if ( defined $::used_default_engine )
+ {
+ # Different default engine is used
+ # tag test to require that engine
+ $tinfo->{'ndb_test'}= 1
+ if ( $::used_default_engine =~ /^ndb/i );
+
+ $tinfo->{'innodb_test'}= 1
+ if ( $::used_default_engine =~ /^innodb/i );
+ }
+
if ( $tinfo->{'big_test'} and ! $::opt_big_test )
{
$tinfo->{'skip'}= 1;
diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl
index 690ca8313dd..53bf37bcc83 100644
--- a/mysql-test/lib/mtr_process.pl
+++ b/mysql-test/lib/mtr_process.pl
@@ -38,8 +38,8 @@ sub mtr_kill_processes ($);
sub mtr_ping_with_timeout($);
sub mtr_ping_port ($);
-# static in C
-sub spawn_impl ($$$$$$$$);
+# Local function
+sub spawn_impl ($$$$$$$);
##############################################################################
#
@@ -47,18 +47,16 @@ sub spawn_impl ($$$$$$$$);
#
##############################################################################
-# This function try to mimic the C version used in "netware/mysql_test_run.c"
-
sub mtr_run ($$$$$$;$) {
my $path= shift;
my $arg_list_t= shift;
my $input= shift;
my $output= shift;
my $error= shift;
- my $pid_file= shift;
+ my $pid_file= shift; # Not used
my $spawn_opts= shift;
- return spawn_impl($path,$arg_list_t,'run',$input,$output,$error,$pid_file,
+ return spawn_impl($path,$arg_list_t,'run',$input,$output,$error,
$spawn_opts);
}
@@ -68,10 +66,10 @@ sub mtr_run_test ($$$$$$;$) {
my $input= shift;
my $output= shift;
my $error= shift;
- my $pid_file= shift;
+ my $pid_file= shift; # Not used
my $spawn_opts= shift;
- return spawn_impl($path,$arg_list_t,'test',$input,$output,$error,$pid_file,
+ return spawn_impl($path,$arg_list_t,'test',$input,$output,$error,
$spawn_opts);
}
@@ -81,28 +79,22 @@ sub mtr_spawn ($$$$$$;$) {
my $input= shift;
my $output= shift;
my $error= shift;
- my $pid_file= shift;
+ my $pid_file= shift; # Not used
my $spawn_opts= shift;
- return spawn_impl($path,$arg_list_t,'spawn',$input,$output,$error,$pid_file,
+ return spawn_impl($path,$arg_list_t,'spawn',$input,$output,$error,
$spawn_opts);
}
-##############################################################################
-#
-# If $join is set, we return the error code, else we return the PID
-#
-##############################################################################
-sub spawn_impl ($$$$$$$$) {
+sub spawn_impl ($$$$$$$) {
my $path= shift;
my $arg_list_t= shift;
my $mode= shift;
my $input= shift;
my $output= shift;
my $error= shift;
- my $pid_file= shift; # FIXME
my $spawn_opts= shift;
if ( $::opt_script_debug )
@@ -155,10 +147,6 @@ sub spawn_impl ($$$$$$$$) {
else
{
# Child, redirect output and exec
- # FIXME I tried POSIX::setsid() here to detach and, I hoped,
- # avoid zombies. But everything went wild, somehow the parent
- # became a deamon as well, and was hard to kill ;-)
- # Need to catch SIGCHLD and do waitpid or something instead......
$SIG{INT}= 'DEFAULT'; # Parent do some stuff, we don't
@@ -196,7 +184,15 @@ sub spawn_impl ($$$$$$$$) {
}
else
{
- if ( ! open(STDERR,$log_file_open_mode,$error) )
+ if ( $::glob_win32_perl )
+ {
+ # Don't redirect stdout on ActiveState perl since this is
+ # just another thread in the same process.
+ # Should be fixed so that the thread that is created with fork
+ # executes the exe in another process and wait's for it to return.
+ # In the meanwhile, we get all the output from mysqld's to screen
+ }
+ elsif ( ! open(STDERR,$log_file_open_mode,$error) )
{
mtr_child_error("can't redirect STDERR to \"$error\": $!");
}
@@ -259,9 +255,7 @@ sub spawn_parent_impl {
# We do blocking waitpid() until we get the return from the
# "mysqltest" call. But if a mysqld process dies that we
# started, we take this as an error, and kill mysqltest.
- #
- # FIXME is this as it should be? Can't mysqld terminate
- # normally from running a test case?
+
my $exit_value= -1;
my $saved_exit_value;
@@ -450,7 +444,6 @@ sub mtr_kill_leftovers () {
# We scan the "var/run/" directory for other process id's to kill
- # FIXME $path_run_dir or something
my $rundir= "$::opt_vardir/run";
mtr_debug("Processing PID files in directory '$rundir'...");