1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge 10.4 into 10.5

This commit is contained in:
Marko Mäkelä
2020-05-31 10:28:59 +03:00
141 changed files with 3170 additions and 952 deletions

View File

@ -377,32 +377,6 @@ my $opt_stop_keep_alive= $ENV{MTR_STOP_KEEP_ALIVE};
select(STDOUT);
$| = 1; # Automatically flush STDOUT
my $set_titlebar;
BEGIN {
if (IS_WINDOWS) {
my $have_win32_console= 0;
eval {
require Win32::Console;
Win32::Console->import();
$have_win32_console = 1;
};
eval 'sub HAVE_WIN32_CONSOLE { $have_win32_console }';
} else {
eval 'sub HAVE_WIN32_CONSOLE { 0 }';
}
}
if (-t STDOUT) {
if (IS_WINDOWS and HAVE_WIN32_CONSOLE) {
$set_titlebar = sub {Win32::Console::Title $_[0];};
} elsif (defined $ENV{TERM} and $ENV{TERM} =~ /xterm/) {
$set_titlebar = sub { syswrite STDOUT, "\e];$_[0]\a"; };
}
}
main();
sub main {
@ -475,7 +449,7 @@ sub main {
}
#######################################################################
my $num_tests= @$tests;
my $num_tests= $mtr_report::tests_total= @$tests;
if ( $opt_parallel eq "auto" ) {
# Try to find a suitable value for number of workers
if (IS_WINDOWS)
@ -916,8 +890,6 @@ sub run_test_server ($$$) {
delete $next->{reserved};
}
titlebar_stat(scalar(@$tests)) if $set_titlebar;
if ($next) {
# We don't need this any more
delete $next->{criteria};
@ -6586,23 +6558,3 @@ sub list_options ($) {
exit(1);
}
sub time_format($) {
sprintf '%d:%02d:%02d', $_[0]/3600, ($_[0]/60)%60, $_[0]%60;
}
our $num_tests;
sub titlebar_stat {
my ($left) = @_;
# 2.5 -> best by test
$num_tests = $left + 2.5 unless $num_tests;
my $done = $num_tests - $left;
my $spent = time - $^T;
&$set_titlebar(sprintf "mtr: spent %s on %d tests. %s (%d tests) left",
time_format($spent), $done,
time_format($spent/$done * $left), $left);
}