]> granicus.if.org Git - pgbadger/commitdiff
Fix missing queries using temp files and locks with CSV log files. Thanks to avandras...
authorDarold Gilles <gilles@darold.net>
Mon, 28 Oct 2013 15:27:36 +0000 (16:27 +0100)
committerDarold Gilles <gilles@darold.net>
Mon, 28 Oct 2013 15:27:36 +0000 (16:27 +0100)
pgbadger

index 45480d38a4d485e3d5b0e838a7913bf15d0d5e63..ab8db11ba2062cd3be721ed659c6197b2598e5ba 100755 (executable)
--- 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;
        }