]> granicus.if.org Git - pgbadger/commitdiff
Fix broken queries with multiline in bind parameters. Thank to Nicolas Thauvin for...
authorDarold Gilles <gilles@darold.net>
Mon, 22 Jun 2015 16:36:48 +0000 (18:36 +0200)
committerDarold Gilles <gilles@darold.net>
Mon, 22 Jun 2015 16:36:48 +0000 (18:36 +0200)
pgbadger

index ef3a99842a1824bac63b7fc524df9afc27825e93..54d4b155175e793449b1bc6485fbc18ba843a8da 100755 (executable)
--- a/pgbadger
+++ b/pgbadger
@@ -2374,6 +2374,9 @@ sub process_file
 
                                        if (exists $cur_plan_info{$cur_pid}{duration}) {
                                                $cur_plan_info{$cur_pid}{plan} .= "\n" . $line;
+                                       } elsif (exists $cur_info{$cur_pid}{parameters}) {
+                                               # stores bind parameters if any
+                                               $cur_info{$cur_pid}{parameters} .= "\n" . $line;
                                        } elsif (exists $cur_temp_info{$cur_pid}{query}) {
                                                $cur_temp_info{$cur_pid}{query} .= "\n" . $line;
                                        } elsif (exists $cur_lock_info{$cur_pid}{query}) {
@@ -2501,6 +2504,9 @@ sub process_file
 
                                        if (exists $cur_plan_info{$cur_pid}{duration}) {
                                                $cur_plan_info{$cur_pid}{plan} .= "\n" . $line;
+                                       } elsif (exists $cur_info{$cur_pid}{parameters}) {
+                                               # stores bind parameters if any
+                                               $cur_info{$cur_pid}{parameters} .= "\n" . $line;
                                        } elsif (exists $cur_temp_info{$cur_pid}{size}) {
                                                if (exists $cur_info{$cur_pid}{query} && !$cur_temp_info{$cur_pid}{query}) {
                                                        $cur_temp_info{$cur_pid}{query} = $cur_info{$cur_pid}{query};