From: Darold Gilles Date: Tue, 25 Sep 2012 09:03:38 +0000 (+0200) Subject: Fix issue #28: Illegal division by zero with log file without query and txt output... X-Git-Tag: v3.2~141 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a19973dc0b0d74a71ad451179e12fe95663f30b0;p=pgbadger Fix issue #28: Illegal division by zero with log file without query and txt output. Thanks to rlowe for the report. --- diff --git a/pgbadger b/pgbadger index ee36e42..7522110 100755 --- a/pgbadger +++ b/pgbadger @@ -1087,7 +1087,7 @@ Report not supported by text format # INSERT/DELETE/UPDATE/SELECT repartition my $totala = $overall_stat{'SELECT'} + $overall_stat{'INSERT'} + $overall_stat{'UPDATE'} + $overall_stat{'DELETE'}; - my $total = $overall_stat{'queries_number'}; + my $total = $overall_stat{'queries_number'} || 1; print $fh "\n- Queries by type ------------------------------------------------------\n\n"; print $fh "Type Count Percentage\n"; print $fh "SELECT: ", &comma_numbers($overall_stat{'SELECT'}) || 0, " ",