From: Darold Gilles Date: Mon, 28 Oct 2013 15:27:36 +0000 (+0100) Subject: Fix missing queries using temp files and locks with CSV log files. Thanks to avandras... X-Git-Tag: v4.0~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0d333d8663673692642941ed418ed0aa243f0de6;p=pgbadger Fix missing queries using temp files and locks with CSV log files. Thanks to avandras for the report. --- diff --git a/pgbadger b/pgbadger index 45480d3..ab8db11 100755 --- a/pgbadger +++ b/pgbadger @@ -5286,6 +5286,15 @@ sub parse_query # Store current lock information that will be used later # when we will parse the query responsible of the locks $cur_lock_info{$t_pid}{wait} = $3; + if ($format eq 'csv') { + $cur_lock_info{$t_pid}{query} = $prefix_vars{'t_statement'}; + $cur_lock_info{$t_pid}{timestamp} = $prefix_vars{'t_timestamp'}; + $cur_lock_info{$t_pid}{dbname} = $prefix_vars{'t_dbname'}; + $cur_lock_info{$t_pid}{dbuser} = $prefix_vars{'t_dbuser'}; + $cur_lock_info{$t_pid}{dbclient} = $prefix_vars{'t_client'}; + $cur_lock_info{$t_pid}{dbappname} = $prefix_vars{'t_appname'}; + $cur_lock_info{$t_pid}{timestamp} = $prefix_vars{'t_timestamp'}; + } return; } @@ -5312,6 +5321,15 @@ sub parse_query # Store current temporary file information that will be used later # when we will parse the query responsible of the tempfile $cur_temp_info{$t_pid}{size} = $1; + if ($format eq 'csv') { + $cur_temp_info{$t_pid}{query} = $prefix_vars{'t_statement'}; + $cur_temp_info{$t_pid}{timestamp} = $prefix_vars{'t_timestamp'}; + $cur_temp_info{$t_pid}{dbname} = $prefix_vars{'t_dbname'}; + $cur_temp_info{$t_pid}{dbuser} = $prefix_vars{'t_dbuser'}; + $cur_temp_info{$t_pid}{dbclient} = $prefix_vars{'t_client'}; + $cur_temp_info{$t_pid}{dbappname} = $prefix_vars{'t_appname'}; + $cur_temp_info{$t_pid}{timestamp} = $prefix_vars{'t_timestamp'}; + } return; }