mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-09 18:30:16 +00:00
Merged fix-903510-pt-tcp-model-empty-requests-file
This commit is contained in:
@@ -1832,7 +1832,10 @@ sub parse_event {
|
||||
if ( $self->{in_prg} ) {
|
||||
die "Error: no more lines, but in_prg = $self->{in_prg}";
|
||||
}
|
||||
if ( $self->{t_start} < $self->{current_ts} ) {
|
||||
if ( defined $self->{t_start}
|
||||
&& defined $self->{current_ts}
|
||||
&& $self->{t_start} < $self->{current_ts} )
|
||||
{
|
||||
PTDEBUG && _d("Returning event based on what's been seen");
|
||||
return $self->make_event($self->{t_start}, $self->{current_ts});
|
||||
}
|
||||
|
@@ -122,7 +122,10 @@ sub parse_event {
|
||||
if ( $self->{in_prg} ) {
|
||||
die "Error: no more lines, but in_prg = $self->{in_prg}";
|
||||
}
|
||||
if ( $self->{t_start} < $self->{current_ts} ) {
|
||||
if ( defined $self->{t_start}
|
||||
&& defined $self->{current_ts}
|
||||
&& $self->{t_start} < $self->{current_ts} )
|
||||
{
|
||||
PTDEBUG && _d("Returning event based on what's been seen");
|
||||
return $self->make_event($self->{t_start}, $self->{current_ts});
|
||||
}
|
||||
|
@@ -9,7 +9,7 @@ BEGIN {
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
use English qw(-no_match_vars);
|
||||
use Test::More tests => 2;
|
||||
use Test::More;
|
||||
|
||||
use PerconaTest;
|
||||
shift @INC; # our unshift (above)
|
||||
@@ -45,7 +45,19 @@ ok(
|
||||
'Analysis for sorted001.txt (issue 1341)'
|
||||
);
|
||||
|
||||
($output) = full_output(
|
||||
sub { pt_tcp_model::main(@args,
|
||||
'--type=requests', "$trunk/t/lib/samples/empty.txt"
|
||||
) }
|
||||
);
|
||||
|
||||
is(
|
||||
$output,
|
||||
'',
|
||||
"--type=requests doesn't die on an empty file",
|
||||
);
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
exit;
|
||||
done_testing;
|
||||
|
Reference in New Issue
Block a user