mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
5.5-merge
This commit is contained in:
@ -1,4 +1,20 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Library General Public
|
||||
# License as published by the Free Software Foundation; version 2
|
||||
# of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Library General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
package My::ConfigFactory;
|
||||
|
||||
use strict;
|
||||
@ -130,7 +146,11 @@ sub fix_tmpdir {
|
||||
sub fix_log_error {
|
||||
my ($self, $config, $group_name, $group)= @_;
|
||||
my $dir= $self->{ARGS}->{vardir};
|
||||
return "$dir/log/$group_name.err";
|
||||
if ( $::opt_valgrind and $::opt_debug ) {
|
||||
return "$dir/log/$group_name.trace";
|
||||
} else {
|
||||
return "$dir/log/$group_name.err";
|
||||
}
|
||||
}
|
||||
|
||||
sub fix_log {
|
||||
|
@ -1,5 +1,5 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (C) 2004-2006 MySQL AB
|
||||
# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -21,6 +21,7 @@ use Carp;
|
||||
use My::Platform;
|
||||
|
||||
use File::Temp qw/ tempfile tempdir /;
|
||||
use mtr_results;
|
||||
|
||||
my $hint_mysqld; # Last resort guess for executable path
|
||||
|
||||
@ -80,7 +81,7 @@ sub _gdb {
|
||||
return if $? >> 8;
|
||||
return unless $gdb_output;
|
||||
|
||||
print <<EOF, $gdb_output, "\n";
|
||||
resfile_print <<EOF, $gdb_output, "\n";
|
||||
Output from gdb follows. The first stack trace is from the failing thread.
|
||||
The following stack traces are from all threads (so the failing one is
|
||||
duplicated).
|
||||
@ -124,7 +125,7 @@ sub _dbx {
|
||||
return if $? >> 8;
|
||||
return unless $dbx_output;
|
||||
|
||||
print <<EOF, $dbx_output, "\n";
|
||||
resfile_print <<EOF . $dbx_output . "\n";
|
||||
Output from dbx follows. Stack trace is printed for all threads in order,
|
||||
above this you should see info about which thread was the failing one.
|
||||
----------------------------
|
||||
@ -244,7 +245,7 @@ sub _cdb {
|
||||
$cdb_output=~ s/^Child\-SP RetAddr Call Site//gm;
|
||||
$cdb_output=~ s/\+0x([0-9a-fA-F]+)//gm;
|
||||
|
||||
print <<EOF, $cdb_output, "\n";
|
||||
resfile_print <<EOF, $cdb_output, "\n";
|
||||
Output from cdb follows. Faulting thread is printed twice,with and without function parameters
|
||||
Search for STACK_TEXT to see the stack trace of
|
||||
the faulting thread. Callstacks of other threads are printed after it.
|
||||
|
@ -1,4 +1,19 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
package My::File::Path;
|
||||
use strict;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (C) 2004-2006 MySQL AB
|
||||
# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -28,8 +28,6 @@ use My::Platform;
|
||||
use base qw(Exporter);
|
||||
our @EXPORT= qw(my_find_bin my_find_dir my_find_file NOT_REQUIRED);
|
||||
|
||||
our $vs_config_dir;
|
||||
|
||||
my $bin_extension= ".exe" if IS_WINDOWS;
|
||||
|
||||
# Helper function to be used for fourth parameter to find functions
|
||||
@ -158,7 +156,7 @@ sub my_find_paths {
|
||||
# User can select to look in a special build dir
|
||||
# which is a subdirectory of any of the paths
|
||||
my @extra_dirs;
|
||||
my $build_dir= $vs_config_dir || $ENV{MTR_VS_CONFIG} || $ENV{MTR_BUILD_DIR};
|
||||
my $build_dir= $::opt_vs_config || $ENV{MTR_VS_CONFIG} || $ENV{MTR_BUILD_DIR};
|
||||
push(@extra_dirs, $build_dir) if defined $build_dir;
|
||||
|
||||
if (defined $extension){
|
||||
|
@ -1,5 +1,5 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (C) 2004-2006 MySQL AB
|
||||
# Copyright (C) 2008 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -1,5 +1,5 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (C) 2004-2006 MySQL AB
|
||||
# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -1,14 +1,15 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (C) 2004-2006 MySQL AB
|
||||
# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Library General Public
|
||||
# License as published by the Free Software Foundation; version 2
|
||||
# of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Library General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
@ -138,6 +139,7 @@ sub new {
|
||||
my $host = delete($opts{'host'});
|
||||
my $shutdown = delete($opts{'shutdown'});
|
||||
my $user_data= delete($opts{'user_data'});
|
||||
my $envs = delete($opts{'envs'});
|
||||
|
||||
# if (defined $host) {
|
||||
# $safe_script= "lib/My/SafeProcess/safe_process_cpcd.pl";
|
||||
@ -160,6 +162,13 @@ sub new {
|
||||
# Point the safe_process at the right parent if running on cygwin
|
||||
push(@safe_args, "--parent-pid=".Cygwin::pid_to_winpid($$)) if IS_CYGWIN;
|
||||
|
||||
foreach my $env_var (@$envs) {
|
||||
croak("Missing = in env string") unless $env_var =~ /=/;
|
||||
croak("Env string $env_var seen, probably missing value for --mysqld-env")
|
||||
if $env_var =~ /^--/;
|
||||
push @safe_args, "--env $env_var";
|
||||
}
|
||||
|
||||
push(@safe_args, "--");
|
||||
push(@safe_args, $path); # The program safe_process should execute
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (C) 2004-2006 MySQL AB
|
||||
# Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -1,25 +0,0 @@
|
||||
# Copyright (C) 2000-2006 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
testroot = $(prefix)
|
||||
safedir = $(testroot)/mysql-test/lib/My/SafeProcess
|
||||
#nobase_bin_PROGRAMS = ...
|
||||
safe_PROGRAMS = my_safe_process
|
||||
|
||||
my_safe_process_SOURCES = safe_process.cc
|
||||
|
||||
EXTRA_DIST = safe_kill_win.cc \
|
||||
safe_process_win.cc \
|
||||
CMakeLists.txt
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2004 MySQL AB
|
||||
/* Copyright (C) 2008 MySQL AB, 2009 Sun Microsystems, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2008 MySQL AB
|
||||
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -176,7 +176,7 @@ int main(int argc, char* const argv[] )
|
||||
} else {
|
||||
if ( strcmp(arg, "--verbose") == 0 )
|
||||
verbose++;
|
||||
else if ( strncmp(arg, "--parent-pid", 10) == 0 )
|
||||
else if ( strncmp(arg, "--parent-pid", 12) == 0 )
|
||||
{
|
||||
/* Override parent_pid with a value provided by user */
|
||||
const char* start;
|
||||
@ -185,10 +185,15 @@ int main(int argc, char* const argv[] )
|
||||
start++; /* Step past = */
|
||||
if ((parent_pid= atoi(start)) == 0)
|
||||
die("Invalid value '%s' passed to --parent-id", start);
|
||||
} else if ( strcmp(arg, "--nocore") == 0 )
|
||||
}
|
||||
else if ( strcmp(arg, "--nocore") == 0 )
|
||||
{
|
||||
nocore = true; // Don't allow the process to dump core
|
||||
}
|
||||
else if ( strncmp (arg, "--env ", 6) == 0 )
|
||||
{
|
||||
putenv(strdup(arg+6));
|
||||
}
|
||||
else
|
||||
die("Unknown option: %s", arg);
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ eval {
|
||||
local $SIG{INT}= \&handle_signal;
|
||||
local $SIG{CHLD}= sub {
|
||||
message("Got signal @_");
|
||||
kill(9, -$child_pid);
|
||||
kill('KILL', -$child_pid);
|
||||
my $ret= waitpid($child_pid, 0);
|
||||
if ($? & 127){
|
||||
exit(65); # Killed by signal
|
||||
@ -134,7 +134,7 @@ if ( $@ ) {
|
||||
# Use negative pid in order to kill the whole
|
||||
# process group
|
||||
#
|
||||
my $ret= kill(9, -$child_pid);
|
||||
my $ret= kill('KILL', -$child_pid);
|
||||
message("Killed child: $child_pid, ret: $ret");
|
||||
if ($ret > 0) {
|
||||
message("Killed child: $child_pid");
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2004 MySQL AB
|
||||
/* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -220,6 +220,10 @@ int main(int argc, const char** argv )
|
||||
{
|
||||
nocore= TRUE;
|
||||
}
|
||||
else if ( strncmp (arg, "--env ", 6) == 0 )
|
||||
{
|
||||
putenv(strdup(arg+6));
|
||||
}
|
||||
else
|
||||
die("Unknown option: %s", arg);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (C) 2004-2006 MySQL AB
|
||||
# Copyright (C) 2008 MySQL AB
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -1,4 +1,18 @@
|
||||
# -*- cperl -*-
|
||||
# Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; version 2 of the License.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
#
|
||||
@ -10,6 +24,7 @@ use strict;
|
||||
use warnings;
|
||||
use Carp;
|
||||
use Storable();
|
||||
use mtr_results;
|
||||
|
||||
|
||||
sub new {
|
||||
@ -47,9 +62,26 @@ sub is_failed {
|
||||
}
|
||||
|
||||
|
||||
my %result_names= (
|
||||
'MTR_RES_PASSED' => 'pass',
|
||||
'MTR_RES_FAILED' => 'fail',
|
||||
'MTR_RES_SKIPPED' => 'skipped',
|
||||
);
|
||||
|
||||
sub write_test {
|
||||
my ($test, $sock, $header)= @_;
|
||||
|
||||
if ($::opt_resfile && defined $test->{'result'}) {
|
||||
resfile_test_info("result", $result_names{$test->{'result'}});
|
||||
if ($test->{'timeout'}) {
|
||||
resfile_test_info("comment", "Timeout");
|
||||
} elsif (defined $test->{'comment'}) {
|
||||
resfile_test_info("comment", $test->{'comment'});
|
||||
}
|
||||
resfile_test_info("result", "warning") if defined $test->{'check'};
|
||||
resfile_to_test($test);
|
||||
}
|
||||
|
||||
# Give the test a unique key before serializing it
|
||||
$test->{key}= "$test" unless defined $test->{key};
|
||||
|
||||
@ -67,8 +99,8 @@ sub read_test {
|
||||
my $test= Storable::thaw($serialized);
|
||||
die "wrong class (hack attempt?)"
|
||||
unless ref($test) eq 'My::Test';
|
||||
resfile_from_test($test) if $::opt_resfile;
|
||||
return $test;
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
Reference in New Issue
Block a user