mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
Merge with MariaDB 5.1
This commit is contained in:
@@ -1,5 +1,23 @@
|
||||
#!/usr/bin/perl
|
||||
# -*- cperl -*-
|
||||
|
||||
# Copyright (c) 2004, 2011, Oracle and/or its affiliates.
|
||||
# Copyright (c) 2009-2011 Monty Program Ab
|
||||
#
|
||||
# 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
|
||||
|
||||
#
|
||||
##############################################################################
|
||||
#
|
||||
@@ -169,6 +187,7 @@ my $opt_cursor_protocol;
|
||||
my $opt_view_protocol;
|
||||
|
||||
our $opt_debug;
|
||||
our $opt_debug_server;
|
||||
our @opt_cases; # The test cases names in argv
|
||||
our $opt_embedded_server;
|
||||
|
||||
@@ -996,6 +1015,7 @@ sub command_line_setup {
|
||||
|
||||
# Debugging
|
||||
'debug' => \$opt_debug,
|
||||
'debug-server' => \$opt_debug_server,
|
||||
'gdb' => \$opt_gdb,
|
||||
'client-gdb' => \$opt_client_gdb,
|
||||
'manual-gdb' => \$opt_manual_gdb,
|
||||
@@ -1162,6 +1182,20 @@ sub command_line_setup {
|
||||
"$basedir/sql/share/charsets",
|
||||
"$basedir/share/charsets");
|
||||
|
||||
# --debug implies we run debug server
|
||||
$opt_debug_server= 1 if $opt_debug;
|
||||
|
||||
if (using_extern())
|
||||
{
|
||||
# Connect to the running mysqld and find out what it supports
|
||||
collect_mysqld_features_from_running_server();
|
||||
}
|
||||
else
|
||||
{
|
||||
# Run the mysqld to find out what features are available
|
||||
collect_mysqld_features();
|
||||
}
|
||||
|
||||
if ( $opt_comment )
|
||||
{
|
||||
mtr_report();
|
||||
@@ -1187,7 +1221,7 @@ sub command_line_setup {
|
||||
chomp;
|
||||
# remove comments (# foo) at the beginning of the line, or after a
|
||||
# blank at the end of the line
|
||||
s/( +|^)#.*$//;
|
||||
s/(\s+|^)#.*$//;
|
||||
# If @ platform specifier given, use this entry only if it contains
|
||||
# @<platform> or @!<xxx> where xxx != platform
|
||||
if (/\@.*/)
|
||||
@@ -1198,8 +1232,8 @@ sub command_line_setup {
|
||||
s/\@.*$//;
|
||||
}
|
||||
# remove whitespace
|
||||
s/^ +//;
|
||||
s/ +$//;
|
||||
s/^\s+//;
|
||||
s/\s+$//;
|
||||
# if nothing left, don't need to remember this line
|
||||
if ( $_ eq "" ) {
|
||||
next;
|
||||
@@ -1806,7 +1840,7 @@ sub find_mysqld {
|
||||
my @mysqld_names= ("mysqld", "mysqld-max-nt", "mysqld-max",
|
||||
"mysqld-nt");
|
||||
|
||||
if ( $opt_debug ){
|
||||
if ( $opt_debug_server ){
|
||||
# Put mysqld-debug first in the list of binaries to look for
|
||||
mtr_verbose("Adding mysqld-debug first in list of binaries to look for");
|
||||
unshift(@mysqld_names, "mysqld-debug");
|
||||
@@ -1876,9 +1910,12 @@ sub executable_setup () {
|
||||
sub client_debug_arg($$) {
|
||||
my ($args, $client_name)= @_;
|
||||
|
||||
# Workaround for Bug #50627: drop any debug opt
|
||||
return if $client_name =~ /^mysqlbinlog/;
|
||||
|
||||
if ( $opt_debug ) {
|
||||
mtr_add_arg($args,
|
||||
"--debug=d:t:A,%s/log/%s.trace",
|
||||
"--loose-debug=d:t:A,%s/log/%s.trace",
|
||||
$path_vardir_trace, $client_name)
|
||||
}
|
||||
}
|
||||
@@ -2241,10 +2278,12 @@ sub environment_setup {
|
||||
# mysqlhotcopy
|
||||
# ----------------------------------------------------
|
||||
my $mysqlhotcopy=
|
||||
mtr_pl_maybe_exists("$bindir/scripts/mysqlhotcopy");
|
||||
# Since mysqltest interprets the real path as "false" in an if,
|
||||
# use 1 ("true") to indicate "not exists" so it can be tested for
|
||||
$ENV{'MYSQLHOTCOPY'}= $mysqlhotcopy || 1;
|
||||
mtr_pl_maybe_exists("$basedir/scripts/mysqlhotcopy") ||
|
||||
mtr_pl_maybe_exists("$path_client_bindir/mysqlhotcopy");
|
||||
if ($mysqlhotcopy)
|
||||
{
|
||||
$ENV{'MYSQLHOTCOPY'}= $mysqlhotcopy;
|
||||
}
|
||||
|
||||
# ----------------------------------------------------
|
||||
# perror
|
||||
@@ -2538,9 +2577,9 @@ sub check_debug_support ($) {
|
||||
#mtr_report(" - binaries are not debug compiled");
|
||||
$debug_compiled_binaries= 0;
|
||||
|
||||
if ( $opt_debug )
|
||||
if ( $opt_debug_server )
|
||||
{
|
||||
mtr_error("Can't use --debug, binaries does not support it");
|
||||
mtr_error("Can't use --debug[-server], binary does not support it");
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -4631,8 +4670,10 @@ sub check_expected_crash_and_restart {
|
||||
{
|
||||
mtr_verbose("Crash was expected, file '$expect_file' exists");
|
||||
|
||||
for (my $waits = 0; $waits < 50; $waits++)
|
||||
for (my $waits = 0; $waits < 50; mtr_milli_sleep(100), $waits++)
|
||||
{
|
||||
# Race condition seen on Windows: try again until file not empty
|
||||
next if -z $expect_file;
|
||||
# If last line in expect file starts with "wait"
|
||||
# sleep a little and try again, thus allowing the
|
||||
# test script to control when the server should start
|
||||
@@ -4641,10 +4682,11 @@ sub check_expected_crash_and_restart {
|
||||
if ($last_line =~ /^wait/ )
|
||||
{
|
||||
mtr_verbose("Test says wait before restart") if $waits == 0;
|
||||
mtr_milli_sleep(100);
|
||||
next;
|
||||
}
|
||||
|
||||
# Ignore any partial or unknown command
|
||||
next unless $last_line =~ /^restart/;
|
||||
# If last line begins "restart:", the rest of the line is read as
|
||||
# extra command line options to add to the restarted mysqld.
|
||||
# Anything other than 'wait' or 'restart:' (with a colon) will
|
||||
@@ -4994,6 +5036,8 @@ sub mysqld_start ($$) {
|
||||
my @all_opts= @$extra_opts;
|
||||
if (exists $mysqld->{'restart_opts'}) {
|
||||
push (@all_opts, @{$mysqld->{'restart_opts'}});
|
||||
mtr_verbose(My::Options::toStr("mysqld_start restart",
|
||||
@{$mysqld->{'restart_opts'}}));
|
||||
}
|
||||
mysqld_arguments($args,$mysqld,\@all_opts);
|
||||
|
||||
@@ -5960,6 +6004,8 @@ Options for debugging the product
|
||||
client-gdb Start mysqltest client in gdb
|
||||
ddd Start mysqld in ddd
|
||||
debug Dump trace output for all servers and client programs
|
||||
debug-server Use debug version of server, but without turning on
|
||||
tracing
|
||||
debugger=NAME Start mysqld in the selected debugger
|
||||
gdb Start the mysqld(s) in gdb
|
||||
manual-debug Let user manually start mysqld in debugger, before
|
||||
|
Reference in New Issue
Block a user