From: Darold Gilles Date: Wed, 25 Nov 2015 16:20:35 +0000 (+0100) Subject: Fix uncomplete and wrong queries associated to temporary files when STATEMENT level... X-Git-Tag: v7.2~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7a6f3cd24ef614fbdf00a0e8f98e7d788d7a55cb;p=pgbadger Fix uncomplete and wrong queries associated to temporary files when STATEMENT level log line was missing. Thanks to Mael Rimbault for the report. --- diff --git a/pgbadger b/pgbadger index fc5131e..4aea653 100755 --- a/pgbadger +++ b/pgbadger @@ -2520,7 +2520,9 @@ sub process_file $cur_temp_info{$cur_pid}{dbappname} = $cur_info{$cur_pid}{'appname'}; delete $cur_info{$cur_pid}; } - $cur_temp_info{$cur_pid}{query} .= "\n" . $line; + if (exists $cur_temp_info{$cur_pid}{query} && $cur_temp_info{$cur_pid}{query}) { + $cur_temp_info{$cur_pid}{query} .= "\n" . $line; + } } elsif (exists $cur_lock_info{$cur_pid}{query}) { $cur_lock_info{$cur_pid}{query} .= "\n" . $line; } elsif (exists $cur_cancel_info{$cur_pid}{query}) {