Skip to content

Commit 2d4e089

Browse files
committed
Fix case where no error sample log entries was reported. Thanks to jhn doe for the report.
1 parent 8b76a61 commit 2d4e089

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

pgbadger

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6057,7 +6057,7 @@ sub set_top_error_sample
60576057
# Stop when we have our number of samples
60586058
if (!exists $error_info{$curdb}{$q}{date} || ($#{$error_info{$curdb}{$q}{date}}+1 < $sample))
60596059
{
6060-
if ( $q =~ /deadlock detected/ || (!$statement && $detail && !grep(/^\Q$detail\E$/, @{$error_info{$curdb}{$q}{detail}})) || ($statement && !grep(/^\Q$statement\E$/, @{$error_info{$curdb}{$q}{statement}})) )
6060+
# if ( $q =~ /deadlock detected/ || (!$statement && $detail && !grep(/^\Q$detail\E$/, @{$error_info{$curdb}{$q}{detail}})) || ($statement && !grep(/^\Q$statement\E$/, @{$error_info{$curdb}{$q}{statement}})) )
60616061
{
60626062
push(@{$error_info{$curdb}{$q}{date}}, $date);
60636063
push(@{$error_info{$curdb}{$q}{detail}}, $detail);
@@ -20533,10 +20533,10 @@ sub highlight_code {
2053320533
# if the token is not a keyword, an open parenthesis or a comment
2053420534
if (
2053520535
(
20536-
$self->_is_function( $token, $last_token, $next_token )
20536+
$self->_is_function( $token, $last_token, $next_token )
2053720537
&& $next_token eq '('
2053820538
)
20539-
|| ( !$self->_is_keyword( $token, $next_token, $last_token )
20539+
|| ( not $self->_is_keyword( $token, $next_token, $last_token )
2054020540
&& $next_token ne '('
2054120541
&& $token ne '('
2054220542
&& not $self->_is_comment($token) )

t/02_basics.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ $ret = `perl pgbadger -q --outdir '.' -o $TEXT -o $JSON -o - -x json $LOG > t/re
4444
my $ret2 = `stat --printf='%s' t/ret.json $TEXT $JSON`;
4545
chomp($ret);
4646
chomp($ret2);
47-
ok( $? == 0 && $ret2 eq '13518815900135188', "Multiple output format '$ret2' = '13518815900135188'");
47+
ok( $? == 0 && $ret2 eq '13545016004135450', "Multiple output format '$ret2' = '13545016004135450'");
4848

4949
`perl pgbadger -q -o /tmp/syslog.html $SYSLOG`;
5050
$ret = `perl pgbadger -q -o - $SYSLOG`;

t/03_consistency.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ok( $json_ref->{pgb_session_info}{chronos}{20180912}{16}{count} == 63943, "pgBou
3838

3939
$ret = `ls -la $OUT | awk '{print \$5}'`;
4040
chomp($ret);
41-
ok( $ret == 230257, "Consistent pgbouncer reports $ret != 230257");
41+
ok( $ret == 230561, "Consistent pgbouncer reports $ret != 230561");
4242

4343
`rm -f $OUT`;
4444

0 commit comments

Comments
 (0)