From: Christophe Courtois Date: Thu, 9 Mar 2017 18:35:18 +0000 (+0100) Subject: Sanity check to avoid end time before start time X-Git-Tag: v9.2~14^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=98e0567aba02fbd8ef27875e8c23af83ac0d853a;p=pgbadger Sanity check to avoid end time before start time --- diff --git a/pgbadger b/pgbadger index e9a937e..32bba6e 100644 --- a/pgbadger +++ b/pgbadger @@ -915,6 +915,9 @@ if ($to) { $to = "$1-$2-$3 $4:$5:$6.$7" } } +if ($from && $to && ($from gt $to)) { + localdie("FATAL: begin date is after end time!\n") ; +} # Stores the last parsed line from log file to allow incremental parsing my $LAST_LINE = '';