]> granicus.if.org Git - pgbadger/commitdiff
Force pgbadger to not try to beautify queries bigger than 10kb, this will take too...
authorDarold Gilles <gilles@darold.net>
Thu, 7 Mar 2013 22:12:46 +0000 (23:12 +0100)
committerDarold Gilles <gilles@darold.net>
Thu, 7 Mar 2013 22:12:46 +0000 (23:12 +0100)
pgbadger

index 93ad8f7952b167566eb6e514cb756dc4b84c8177..b5fb43ac2ced62044ca20f97911fcdfdee363d30 100755 (executable)
--- a/pgbadger
+++ b/pgbadger
@@ -4476,6 +4476,10 @@ sub highlight_code
        # Try to escape HTML code
        $code =~ s/<([\/a-zA-Z])\b/\&lt;$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);