From: Darold Date: Sun, 28 Oct 2012 16:11:23 +0000 (+0100) Subject: Fix issue on select_only mode X-Git-Tag: v3.2~110^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=71f24fbf3d66d7cb97e6420fead04f0e8461dc73;p=pgbadger Fix issue on select_only mode --- diff --git a/pgbadger b/pgbadger index 47631e1..bfd1757 100755 --- a/pgbadger +++ b/pgbadger @@ -493,7 +493,6 @@ my $nlines = 0; my %last_line = (); my %saved_last_line = (); my %tsung_session = (); -my $total_tsung_session = 0; my $t0 = Benchmark->new; @@ -3599,7 +3598,6 @@ sub parse_query $tsung_session{$prefix_vars{'t_pid'}}{connection}{database} = $prefix_vars{'t_dbname'}; $tsung_session{$prefix_vars{'t_pid'}}{connection}{user} = $prefix_vars{'t_dbuser'}; $tsung_session{$prefix_vars{'t_pid'}}{connection}{date} = $prefix_vars{'t_date'}; - } if ($prefix_vars{'t_query'} =~ s/duration: ([0-9\.]+) ms (query|statement): //is) { $t_duration = $1; @@ -3664,7 +3662,6 @@ sub store_tsung_session die "FATAL: can't write to $outfile, $!\n"; } if ($pid) { - $total_tsung_session++; print $fh " \n"; if (exists $tsung_session{$pid}{connection}{database}) { print $fh qq{ @@ -3719,7 +3716,7 @@ sub store_queries # Should we just want select queries if ($select_only) { - return if ( ($cur_info{$t_pid}{query} !~ /^SELECT/is) || ($cur_info{$t_pid}{query} != /FOR UPDATE/is) ); + return if ( ($cur_info{$t_pid}{query} !~ /^SELECT/is) || ($cur_info{$t_pid}{query} =~ /FOR UPDATE/is) ); } # Should we have to exclude some queries