diff options
Diffstat (limited to 'mysql-test/lib/My')
-rw-r--r-- | mysql-test/lib/My/Config.pm | 2 | ||||
-rw-r--r-- | mysql-test/lib/My/ConfigFactory.pm | 12 | ||||
-rw-r--r-- | mysql-test/lib/My/CoreDump.pm | 14 | ||||
-rw-r--r-- | mysql-test/lib/My/SafeProcess.pm | 4 | ||||
-rw-r--r-- | mysql-test/lib/My/SafeProcess/safe_process.cc | 14 |
5 files changed, 31 insertions, 15 deletions
diff --git a/mysql-test/lib/My/Config.pm b/mysql-test/lib/My/Config.pm index e5469d8c62e..12647edf0a4 100644 --- a/mysql-test/lib/My/Config.pm +++ b/mysql-test/lib/My/Config.pm @@ -47,7 +47,7 @@ sub option { my $value= $self->{value}; my $opt= $name; - $opt= "$name=$value" if ($value); + $opt= "$name=$value" if (defined $value); $opt= "--$opt" unless ($opt =~ /^--/); return $opt; } diff --git a/mysql-test/lib/My/ConfigFactory.pm b/mysql-test/lib/My/ConfigFactory.pm index f43fc9c1f16..7f8bb163246 100644 --- a/mysql-test/lib/My/ConfigFactory.pm +++ b/mysql-test/lib/My/ConfigFactory.pm @@ -37,7 +37,7 @@ sub add_opt_values { # add auto-options $config->insert('OPT', 'port' => sub { fix_port($self, $config) }); - $config->insert('mysqld', "loose-skip-$_" => undef) for (@::optional_plugins); + $config->insert('mysqld', "loose-skip-plugin-$_" => undef) for (@::optional_plugins); } my @pre_rules= @@ -169,6 +169,13 @@ sub fix_log { return "$dir/mysqld.log"; } +sub fix_bind_address { + if (IS_WINDOWS) { + return "*"; + } else { + return "127.0.0.1"; + } +} sub fix_log_slow_queries { my ($self, $config, $group_name, $group)= @_; my $dir= dirname($group->value('datadir')); @@ -251,6 +258,7 @@ my @mysqld_rules= { 'ssl-ca' => \&fix_ssl_ca }, { 'ssl-cert' => \&fix_ssl_server_cert }, { 'ssl-key' => \&fix_ssl_server_key }, + { 'bind-address' => \&fix_bind_address }, ); if (IS_WINDOWS) @@ -325,6 +333,7 @@ my @cluster_config_rules= # my @client_rules= ( + { 'character-sets-dir' => \&fix_charset_dir }, ); @@ -347,7 +356,6 @@ my @mysqltest_rules= # my @mysqlbinlog_rules= ( - { 'character-sets-dir' => \&fix_charset_dir }, ); diff --git a/mysql-test/lib/My/CoreDump.pm b/mysql-test/lib/My/CoreDump.pm index 1d6d85020c8..1ba94223b68 100644 --- a/mysql-test/lib/My/CoreDump.pm +++ b/mysql-test/lib/My/CoreDump.pm @@ -53,9 +53,19 @@ sub _verify_binpath { sub _gdb { my ($core_name)= @_; - print "\nTrying 'gdb' to get a backtrace\n"; + # Check that gdb exists + `gdb --version`; + if ($?) { + print "gdb not found, cannot get the stack trace\n"; + return; + } - return unless -f $core_name; + if (-f $core_name) { + print "\nTrying 'gdb' to get a backtrace from coredump $core_name\n"; + } else { + print "\nCoredump $core_name does not exist, cannot run 'gdb'\n"; + return; + } # Find out name of binary that generated core `gdb -c '$core_name' --batch 2>&1` =~ diff --git a/mysql-test/lib/My/SafeProcess.pm b/mysql-test/lib/My/SafeProcess.pm index 02467971e77..926d17ed66e 100644 --- a/mysql-test/lib/My/SafeProcess.pm +++ b/mysql-test/lib/My/SafeProcess.pm @@ -34,7 +34,7 @@ package My::SafeProcess; # will zap the "monitored process" and exit # - the "monitored process" to exit, in which case it will exit # itself with same exit code as the "monitored process" -# - the parent process to send the "shutdown" signal in wich case +# - the parent process to send the "shutdown" signal in which case # monitor will kill the "monitored process" hard and exit # # @@ -338,7 +338,7 @@ sub dump_core { my ($self)= @_; return if IS_WINDOWS; my $pid= $self->{SAFE_PID}; - die "Can't cet core from not started process" unless defined $pid; + die "Can't get core from not started process" unless defined $pid; _verbose("Sending ABRT to $self"); kill ("ABRT", $pid); return 1; diff --git a/mysql-test/lib/My/SafeProcess/safe_process.cc b/mysql-test/lib/My/SafeProcess/safe_process.cc index 147dfdec226..77f3974540d 100644 --- a/mysql-test/lib/My/SafeProcess/safe_process.cc +++ b/mysql-test/lib/My/SafeProcess/safe_process.cc @@ -89,7 +89,7 @@ static void die(const char* fmt, ...) } -static void kill_child(bool was_killed) +static int kill_child(bool was_killed) { int status= 0; @@ -108,15 +108,15 @@ static void kill_child(bool was_killed) exit_code= WEXITSTATUS(status); message("Child exit: %d", exit_code); // Exit with exit status of the child - exit(exit_code); + return exit_code; } if (WIFSIGNALED(status)) message("Child killed by signal: %d", WTERMSIG(status)); - exit(exit_code); + return exit_code; } - exit(5); + return 5; } @@ -136,7 +136,7 @@ extern "C" void handle_signal(int sig) terminated= 1; if (child_pid > 0) - kill_child(sig == SIGCHLD); + _exit(kill_child(sig == SIGCHLD)); // Ignore further signals signal(SIGTERM, SIG_IGN); @@ -292,8 +292,6 @@ int main(int argc, char* const argv[] ) /* Wait for parent or child to die */ sleep(1); } - kill_child(0); - - return 4; + return kill_child(0); } |