From 1b28b64b0d6f6ffe5bc37b1bffa17acb2cc036ae Mon Sep 17 00:00:00 2001 From: Dalibo Date: Tue, 11 Nov 2014 13:12:34 +0100 Subject: [PATCH] Fix Illegal division by zero at line 3832. Thanks to MarcoTrek for the report. --- pgbadger | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pgbadger b/pgbadger index 8954e4f..14f2265 100755 --- a/pgbadger +++ b/pgbadger @@ -3829,8 +3829,8 @@ sub print_overall_statistics $query_peak_date = $_; last; } - my $avg_queries = &comma_numbers(int($overall_stat{'queries_number'}/$session_info{count})); - my $avg_duration = &convert_time(int($overall_stat{'queries_duration'}/$session_info{count})); + my $avg_queries = &comma_numbers(int($overall_stat{'queries_number'}/($session_info{count} || 1))); + my $avg_duration = &convert_time(int($overall_stat{'queries_duration'}/($session_info{count} || 1))); my $fmt_errors = &comma_numbers($overall_stat{'errors_number'}); my $fmt_unique_error = &comma_numbers(scalar keys %error_info); my $autovacuum_count = &comma_numbers($autovacuum_info{count}); -- 2.40.0