From d6ebbec33467fc73a5a1e52ed762bb73fa77778b Mon Sep 17 00:00:00 2001 From: Darold Gilles Date: Thu, 7 Mar 2013 23:12:46 +0100 Subject: [PATCH] Force pgbadger to not try to beautify queries bigger than 10kb, this will take too much time. This value can be reduce in the future if hang with long queries still happen. Thanks to John Rouillard for the report. --- pgbadger | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pgbadger b/pgbadger index 93ad8f7..b5fb43a 100755 --- a/pgbadger +++ b/pgbadger @@ -4476,6 +4476,10 @@ sub highlight_code # Try to escape HTML code $code =~ s/<([\/a-zA-Z])\b/\<$1/sg; + # Do not try to prettify queries longuer + # than 10KB this will take too much time + return $code if (length($code) > 10240); + # prettify SQL query if (!$noprettify) { $sql_prettified->query($code); -- 2.50.1