]> granicus.if.org Git - pgbadger/commitdiff
Merge branch 'master' of github.com:darold/pgbadger into align_statements
authorLuca Ferrari <fluca1978@gmail.com>
Mon, 3 Jun 2019 10:04:05 +0000 (12:04 +0200)
committerLuca Ferrari <fluca1978@gmail.com>
Mon, 3 Jun 2019 10:04:50 +0000 (12:04 +0200)
Merge with commit e2e85807ef6bc3d6e1a748c2e52437659c70c665.

1  2 
pgbadger

diff --cc pgbadger
index 5bf25c5f45e0f69fbf1a90211814a559652b97c6,c46f7dcc4fe666df842511fdefb71603c7c40dc6..5b7d5953f2cf797225bebae4ee4bdadde378658a
+++ b/pgbadger
@@@ -2436,7 -2418,7 +2436,6 @@@ sub build_incremental_report
                        my $tmp_dir = "$dest_dir/$db";
                        $tmp_dir = $dest_dir if (!$report_per_database);
                        &logmsg('LOG', "Ok, generating HTML daily report into $tmp_dir/$bpath/...");
--
                        # set path and create subdirectories
                        mkdir("$tmp_dir") if (!-d "$tmp_dir");
                        if ($bpath =~ m#^(\d+)/(\d+)/(\d+)#) {
@@@ -15996,22 -15979,17 +15995,24 @@@ sub skip_unwanted_lin
                                $found = 1;
                                last;
                        }
 -      }
 -              return 1 if ($found);
 -      }
 +    }
++    return 1 if ( $found );
++  }
  
 +  # check begin or end time without the date
 +  # and extract the hour here, late, to get the timezone
 +  # already applied
 +  if ( $from_hour || $to_hour ){
 +      $prefix_vars{'t_time'} = $prefix_vars{'t_timestamp'};
 +      $prefix_vars{'t_time'} =~ s/^(\d{4})-(\d{2})-(\d{2}) //;
  
 -      return 1 if ($from && ($from gt $prefix_vars{'t_timestamp'}));
 -
 -      if ($to   && ($to lt $prefix_vars{'t_timestamp'})) {
 -              return -1;
 -      }
 +      return 1  if ( $from_hour && ( $from_hour gt $prefix_vars{'t_time'} ) );
 +      return -1 if ( $to_hour   && ( $to_hour   lt $prefix_vars{'t_time'} ) );
 +  }
  
 +  # check against date/timestamp
 +      return 1  if ($from && ($from gt $prefix_vars{'t_timestamp'}));
 +  return -1 if ($to   && ($to   lt $prefix_vars{'t_timestamp'}));
        return 0;
  }