mirror of
https://github.com/MariaDB/server.git
synced 2025-08-31 22:22:30 +03:00
Merge with MySQL 5.1.55
- Fixed some issues with partitions and connection_string, which also fixed lp:716890 "Pre- and post-recovery crash in Aria" - Fixed wrong assert in Aria Now need to merge with latest xtradb before pushing sql/ha_partition.cc: Ensure that m_ordered_rec_buffer is not freed before close. sql/mysqld.cc: Changed to use opt_stack_trace instead of opt_pstack. Removed references to pstack sql/partition_element.h: Ensure that connect_string is initialized storage/maria/ma_key_recover.c: Fixed wrong assert
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#!/usr/bin/perl
|
||||
# -*- cperl -*-
|
||||
|
||||
#
|
||||
##############################################################################
|
||||
#
|
||||
@@ -614,6 +613,11 @@ sub run_test_server ($$$) {
|
||||
if ( !$opt_force ) {
|
||||
# Test has failed, force is off
|
||||
push(@$completed, $result);
|
||||
if ($result->{'dont_kill_server'})
|
||||
{
|
||||
print $sock "BYE\n";
|
||||
next;
|
||||
}
|
||||
return ("Failure", 1, $completed, $extra_warnings);
|
||||
}
|
||||
elsif ($opt_max_test_fail > 0 and
|
||||
@@ -719,16 +723,6 @@ sub run_test_server ($$$) {
|
||||
next;
|
||||
}
|
||||
|
||||
# Prefer same configuration, or just use next if --noreorder
|
||||
if (!$opt_reorder or (defined $result and
|
||||
$result->{template_path} eq $t->{template_path}))
|
||||
{
|
||||
#mtr_report("Test uses same config => good match");
|
||||
# Test uses same config => good match
|
||||
$next= splice(@$tests, $i, 1);
|
||||
last;
|
||||
}
|
||||
|
||||
# From secondary choices, we prefer to pick a 'long-running' test if
|
||||
# possible; this helps avoid getting stuck with a few of those at the
|
||||
# end of high --parallel runs, with most workers being idle.
|
||||
@@ -737,6 +731,34 @@ sub run_test_server ($$$) {
|
||||
#mtr_report("Setting second_best to $i");
|
||||
$second_best= $i;
|
||||
}
|
||||
|
||||
# Smart allocation of next test within this thread.
|
||||
|
||||
if ($opt_reorder and $opt_parallel > 1 and defined $result)
|
||||
{
|
||||
my $wid= $result->{worker};
|
||||
# Reserved for other thread, try next
|
||||
next if (defined $t->{reserved} and $t->{reserved} != $wid);
|
||||
if (! defined $t->{reserved})
|
||||
{
|
||||
# Force-restart not relevant when comparing *next* test
|
||||
$t->{criteria} =~ s/force-restart$/no-restart/;
|
||||
my $criteria= $t->{criteria};
|
||||
# Reserve similar tests for this worker, but not too many
|
||||
my $maxres= (@$tests - $i) / $opt_parallel + 1;
|
||||
for (my $j= $i+1; $j <= $i + $maxres; $j++)
|
||||
{
|
||||
my $tt= $tests->[$j];
|
||||
last unless defined $tt;
|
||||
last if $tt->{criteria} ne $criteria;
|
||||
$tt->{reserved}= $wid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# At this point we have found next suitable test
|
||||
$next= splice(@$tests, $i, 1);
|
||||
last;
|
||||
}
|
||||
|
||||
# Use second best choice if no other test has been found
|
||||
@@ -745,12 +767,14 @@ sub run_test_server ($$$) {
|
||||
mtr_error("Internal error, second best too large($second_best)")
|
||||
if $second_best > $#$tests;
|
||||
$next= splice(@$tests, $second_best, 1);
|
||||
delete $next->{reserved};
|
||||
}
|
||||
|
||||
xterm_stat(scalar(@$tests));
|
||||
|
||||
if ($next) {
|
||||
#$next->print_test();
|
||||
# We don't need this any more
|
||||
delete $next->{criteria};
|
||||
$next->write_test($sock, 'TESTCASE');
|
||||
$running{$next->key()}= $next;
|
||||
$num_ndb_tests++ if ($next->{ndb_test});
|
||||
@@ -832,6 +856,11 @@ sub run_worker ($) {
|
||||
delete($test->{'comment'});
|
||||
delete($test->{'logfile'});
|
||||
|
||||
# A sanity check. Should this happen often we need to look at it.
|
||||
if (defined $test->{reserved} && $test->{reserved} != $thread_num) {
|
||||
my $tres= $test->{reserved};
|
||||
mtr_warning("Test reserved for w$tres picked up by w$thread_num");
|
||||
}
|
||||
$test->{worker} = $thread_num if $opt_parallel > 1;
|
||||
|
||||
run_testcase($test, $server);
|
||||
@@ -854,10 +883,14 @@ sub run_worker ($) {
|
||||
else {
|
||||
stop_all_servers($opt_shutdown_timeout);
|
||||
}
|
||||
my $valgrind_reports= 0;
|
||||
if ($opt_valgrind_mysqld) {
|
||||
$valgrind_reports= valgrind_exit_reports();
|
||||
}
|
||||
if ( $opt_gprof ) {
|
||||
gprof_collect (find_mysqld($basedir), keys %gprof_dirs);
|
||||
}
|
||||
exit(0);
|
||||
exit($valgrind_reports);
|
||||
}
|
||||
else {
|
||||
mtr_error("Could not understand server, '$line'");
|
||||
@@ -902,7 +935,7 @@ sub command_line_setup {
|
||||
my $opt_list_options;
|
||||
|
||||
# Read the command line options
|
||||
# Note: Keep list, and the order, in sync with usage at end of this file
|
||||
# Note: Keep list in sync with usage at end of this file
|
||||
Getopt::Long::Configure("pass_through");
|
||||
my %options=(
|
||||
# Control what engine/variation to run
|
||||
@@ -938,6 +971,7 @@ sub command_line_setup {
|
||||
'combination=s' => \@opt_combinations,
|
||||
'skip-combinations' => \&collect_option,
|
||||
'experimental=s' => \@opt_experimentals,
|
||||
# skip-im is deprecated and silently ignored
|
||||
'skip-im' => \&ignore_option,
|
||||
'staging-run' => \$opt_staging_run,
|
||||
|
||||
@@ -1039,8 +1073,9 @@ sub command_line_setup {
|
||||
'max-connections=i' => \$opt_max_connections,
|
||||
|
||||
'help|h' => \$opt_usage,
|
||||
'list-options' => \$opt_list_options,
|
||||
);
|
||||
# list-options is internal, not listed in help
|
||||
'list-options' => \$opt_list_options,
|
||||
);
|
||||
|
||||
GetOptions(%options) or usage("Can't read options");
|
||||
usage("") if $opt_usage;
|
||||
@@ -2088,6 +2123,16 @@ sub environment_setup {
|
||||
$ENV{'DEFAULT_MASTER_PORT'}= $mysqld_variables{'master-port'} || 3306;
|
||||
$ENV{'MYSQL_TMP_DIR'}= $opt_tmpdir;
|
||||
$ENV{'MYSQLTEST_VARDIR'}= $opt_vardir;
|
||||
|
||||
if (IS_WINDOWS)
|
||||
{
|
||||
$ENV{'SECURE_LOAD_PATH'}= $glob_mysql_test_dir."\\std_data";
|
||||
}
|
||||
else
|
||||
{
|
||||
$ENV{'SECURE_LOAD_PATH'}= $glob_mysql_test_dir."/std_data";
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Some stupid^H^H^H^H^H^Hignorant network providers set up "wildcard DNS"
|
||||
@@ -3610,13 +3655,14 @@ sub find_analyze_request
|
||||
|
||||
# The test can leave a file in var/tmp/ to signal
|
||||
# that all servers should be restarted
|
||||
sub restart_forced_by_test
|
||||
sub restart_forced_by_test($)
|
||||
{
|
||||
my $file = shift;
|
||||
my $restart = 0;
|
||||
foreach my $mysqld ( mysqlds() )
|
||||
{
|
||||
my $datadir = $mysqld->value('datadir');
|
||||
my $force_restart_file = "$datadir/mtr/force_restart";
|
||||
my $force_restart_file = "$datadir/mtr/$file";
|
||||
if ( -f $force_restart_file )
|
||||
{
|
||||
mtr_verbose("Restart of servers forced by test");
|
||||
@@ -3951,7 +3997,7 @@ sub run_testcase ($$) {
|
||||
if ( $res == 0 )
|
||||
{
|
||||
my $check_res;
|
||||
if ( restart_forced_by_test() )
|
||||
if ( restart_forced_by_test('force_restart') )
|
||||
{
|
||||
stop_all_servers($opt_shutdown_timeout);
|
||||
}
|
||||
@@ -3990,8 +4036,11 @@ sub run_testcase ($$) {
|
||||
find_testcase_skipped_reason($tinfo);
|
||||
mtr_report_test_skipped($tinfo);
|
||||
# Restart if skipped due to missing perl, it may have had side effects
|
||||
stop_all_servers($opt_shutdown_timeout)
|
||||
if ($tinfo->{'comment'} =~ /^perl not found/);
|
||||
if ( restart_forced_by_test('force_restart_if_skipped') ||
|
||||
$tinfo->{'comment'} =~ /^perl not found/ )
|
||||
{
|
||||
stop_all_servers($opt_shutdown_timeout);
|
||||
}
|
||||
}
|
||||
elsif ( $res == 65 )
|
||||
{
|
||||
@@ -4042,7 +4091,6 @@ sub run_testcase ($$) {
|
||||
# ----------------------------------------------------
|
||||
# Check if it was an expected crash
|
||||
# ----------------------------------------------------
|
||||
SRVDIED:
|
||||
my $check_crash = check_expected_crash_and_restart($proc);
|
||||
if ($check_crash)
|
||||
{
|
||||
@@ -4052,6 +4100,7 @@ sub run_testcase ($$) {
|
||||
next;
|
||||
}
|
||||
|
||||
SRVDIED:
|
||||
# ----------------------------------------------------
|
||||
# Stop the test case timer
|
||||
# ----------------------------------------------------
|
||||
@@ -4728,7 +4777,12 @@ sub after_failure ($) {
|
||||
sub report_failure_and_restart ($) {
|
||||
my $tinfo= shift;
|
||||
|
||||
stop_all_servers();
|
||||
if ($opt_valgrind_mysqld && ($tinfo->{'warnings'} || $tinfo->{'timeout'})) {
|
||||
# In these cases we may want valgrind report from normal termination
|
||||
$tinfo->{'dont_kill_server'}= 1;
|
||||
}
|
||||
# Shotdown properly if not to be killed (for valgrind)
|
||||
stop_all_servers($tinfo->{'dont_kill_server'} ? $opt_shutdown_timeout : 0);
|
||||
|
||||
$tinfo->{'result'}= 'MTR_RES_FAILED';
|
||||
|
||||
@@ -5115,17 +5169,6 @@ sub server_need_restart {
|
||||
}
|
||||
}
|
||||
|
||||
# Temporary re-enable the "always restart slave" hack
|
||||
# this should be removed asap, but will require that each rpl
|
||||
# testcase cleanup better after itself - ie. stop and reset
|
||||
# replication
|
||||
# Use the "#!use-slave-opt" marker to detect that this is a "slave"
|
||||
# server
|
||||
if ( $server->option("#!use-slave-opt") ){
|
||||
mtr_verbose_restart($server, "Always restart slave(s)");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ($server->name() =~ /^mysqld\./)
|
||||
{
|
||||
|
||||
@@ -5730,6 +5773,72 @@ sub strace_arguments {
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Search server logs for valgrind reports printed at mysqld termination
|
||||
#
|
||||
|
||||
sub valgrind_exit_reports() {
|
||||
my $found_err= 0;
|
||||
|
||||
foreach my $log_file (keys %mysqld_logs)
|
||||
{
|
||||
my @culprits= ();
|
||||
my $valgrind_rep= "";
|
||||
my $found_report= 0;
|
||||
my $err_in_report= 0;
|
||||
|
||||
my $LOGF = IO::File->new($log_file)
|
||||
or mtr_error("Could not open file '$log_file' for reading: $!");
|
||||
|
||||
while ( my $line = <$LOGF> )
|
||||
{
|
||||
if ($line =~ /^CURRENT_TEST: (.+)$/)
|
||||
{
|
||||
my $testname= $1;
|
||||
# If we have a report, report it if needed and start new list of tests
|
||||
if ($found_report)
|
||||
{
|
||||
if ($err_in_report)
|
||||
{
|
||||
mtr_print ("Valgrind report from $log_file after tests:\n",
|
||||
@culprits);
|
||||
mtr_print_line();
|
||||
print ("$valgrind_rep\n");
|
||||
$err_in_report= 0;
|
||||
}
|
||||
# Make ready to collect new report
|
||||
@culprits= ();
|
||||
$found_report= 0;
|
||||
$valgrind_rep= "";
|
||||
}
|
||||
push (@culprits, $testname);
|
||||
next;
|
||||
}
|
||||
# This line marks the start of a valgrind report
|
||||
$found_report= 1 if $line =~ /^==\d+== .* SUMMARY:/;
|
||||
|
||||
if ($found_report) {
|
||||
$line=~ s/^==\d+== //;
|
||||
$valgrind_rep .= $line;
|
||||
$err_in_report= 1 if $line =~ /ERROR SUMMARY: [1-9]/;
|
||||
$err_in_report= 1 if $line =~ /definitely lost: [1-9]/;
|
||||
$err_in_report= 1 if $line =~ /possibly lost: [1-9]/;
|
||||
}
|
||||
}
|
||||
|
||||
$LOGF= undef;
|
||||
|
||||
if ($err_in_report) {
|
||||
mtr_print ("Valgrind report from $log_file after tests:\n", @culprits);
|
||||
mtr_print_line();
|
||||
print ("$valgrind_rep\n");
|
||||
$found_err= 1;
|
||||
}
|
||||
}
|
||||
|
||||
return $found_err;
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Usage
|
||||
@@ -5764,7 +5873,7 @@ Options to control what engine/variation to run
|
||||
parallel=# How many parallell test should be run
|
||||
defaults-file=<config template> Use fixed config template for all
|
||||
tests
|
||||
defaults_extra_file=<config template> Extra config template to add to
|
||||
defaults-extra-file=<config template> Extra config template to add to
|
||||
all generated configs
|
||||
combination=<opt> Use at least twice to run tests with specified
|
||||
options to mysqld
|
||||
@@ -5858,6 +5967,9 @@ Options for debugging the product
|
||||
test(s)
|
||||
manual-ddd Let user manually start mysqld in ddd, before running
|
||||
test(s)
|
||||
strace-client[=path] Create strace output for mysqltest client, optionally
|
||||
specifying name and path to the trace program to use.
|
||||
Example: $0 --strace-client=ktrace
|
||||
max-save-core Limit the number of core files saved (to avoid filling
|
||||
up disks for heavily crashing server). Defaults to
|
||||
$opt_max_save_core, set to 0 for no limit. Set
|
||||
@@ -5897,7 +6009,7 @@ Options for strace
|
||||
Misc options
|
||||
user=USER User for connecting to mysqld(default: $opt_user)
|
||||
comment=STR Write STR to the output
|
||||
notimer Don't show test case execution time
|
||||
timer Show test case execution time.
|
||||
verbose More verbose output(use multiple times for even more)
|
||||
verbose-restart Write when and why servers are restarted
|
||||
start Only initialize and start the servers, using the
|
||||
@@ -5951,6 +6063,7 @@ Misc options
|
||||
gcov-src-dir=subdir Colllect coverage only within the given subdirectory.
|
||||
For example, if you're only developing the SQL layer,
|
||||
it makes sense to use --gcov-src-dir=sql
|
||||
gprof Collect profiling information using gprof.
|
||||
experimental=<file> Refer to list of tests considered experimental;
|
||||
failures will be marked exp-fail instead of fail.
|
||||
report-features First run a "test" that reports mysql features
|
||||
@@ -5959,6 +6072,10 @@ Misc options
|
||||
*previous* test started
|
||||
max-connections=N Max number of open connection to server in mysqltest
|
||||
|
||||
Some options that control enabling a feature for normal test runs,
|
||||
can be turned off by prepending 'no' to the option, e.g. --notimer.
|
||||
This applies to reorder, timer, check-testcases and warnings.
|
||||
|
||||
HERE
|
||||
exit(1);
|
||||
|
||||
|
Reference in New Issue
Block a user