]> granicus.if.org Git - pgbadger/commitdiff
Fix issue #28: Illegal division by zero with log file without query and txt output...
authorDarold Gilles <gilles@darold.net>
Tue, 25 Sep 2012 09:03:38 +0000 (11:03 +0200)
committerDarold Gilles <gilles@darold.net>
Tue, 25 Sep 2012 09:03:38 +0000 (11:03 +0200)
pgbadger

index ee36e424c3d5f9dcda3acb654b4da4a638a39029..7522110eab44aff21cab26efaff9339d9073bf94 100755 (executable)
--- 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, " ",