From 1af61fa4272b867d22cde66d702fc669295ea1dc Mon Sep 17 00:00:00 2001 From: Pav Lucistnik Date: Mon, 26 Oct 2009 15:56:07 +0000 Subject: - Squelch perl warning triggered when a client is connected to the server and his IP cannot be resolved into a hostname PR: ports/139615 Submitted by: Miroslav Lachman <000.fbsd@quip.cz> Approved by: Matthew Seaman (maintainer) --- databases/mytop/files/patch-mytop | 76 ++++++++++++++++++++++----------------- 1 file changed, 44 insertions(+), 32 deletions(-) (limited to 'databases/mytop/files') diff --git a/databases/mytop/files/patch-mytop b/databases/mytop/files/patch-mytop index eb1f1d7bc80e..b2f92386f85b 100644 --- a/databases/mytop/files/patch-mytop +++ b/databases/mytop/files/patch-mytop @@ -1,5 +1,14 @@ ---- mytop.orig 2007-02-16 20:57:46.000000000 -0800 -+++ mytop 2008-07-06 08:27:54.000000000 -0700 +--- mytop.orig 2007-02-17 05:57:46.000000000 +0100 ++++ mytop 2009-10-15 00:19:14.000000000 +0200 +@@ -153,7 +153,7 @@ + "idle|i" => \$config{idle}, + "resolve|r" => \$config{resolve}, + "prompt!" => \$config{prompt}, +- "long|!" => \$config{long_nums}, ++ "long!" => \$config{long_nums}, + "mode|m=s" => \$config{mode}, + "sort=s" => \$config{sort}, + ); @@ -193,6 +193,7 @@ *BLUE = sub { }; *WHITE = sub { }; @@ -36,6 +45,24 @@ next; } +@@ -710,7 +716,7 @@ + ## + if ($config{header}) + { +- my @recs = Hashes("show status"); ++ my @recs = Hashes("SHOW /*!50002 GLOBAL */ STATUS"); + + ## if the server died or we lost connectivity + if (not @recs) +@@ -819,7 +825,7 @@ + $lines_left--; + + +- printf " Queries: %-5s qps: %4.0f Slow: %7s Se/In/Up/De(%%): %02.0f/%02.0f/%02.0f/%02.0f \n", ++ printf " Queries: %-6s qps: %4.0f Slow: %7s Se/In/Up/De(%%): %02.0f/%02.0f/%02.0f/%02.0f \n", + make_short( $STATUS{Questions} ), # q total + $STATUS{Questions} / $STATUS{Uptime}, # qps, average + make_short( $STATUS{Slow_queries} ), # slow @@ -889,8 +895,42 @@ make_short(($STATUS{Bytes_received} - $OLD_STATUS{Bytes_received}) / $t_delta ), make_short(($STATUS{Bytes_sent} - $OLD_STATUS{Bytes_sent}) / $t_delta )) @@ -80,7 +107,21 @@ $lines_left--; } -@@ -1099,8 +1139,8 @@ +@@ -952,8 +992,11 @@ + { + $thread->{Host} =~ s/:\d+$//; + my $host = gethostbyaddr(inet_aton($thread->{Host}), AF_INET); +- $host =~ s/^([^.]+).*/$1/; +- $thread->{Host} = $host; ++ if ($host) ++ { ++ $host =~ s/^([^.]+).*/$1/; ++ $thread->{Host} = $host; ++ } + } + + ## Fix possible undefs +@@ -1099,8 +1142,8 @@ my @data = Hashes("SHOW INNODB STATUS"); open P, "|$config{pager}" or die "$!"; @@ -91,32 +132,3 @@ close P; } ---- mytop.orig 2009-09-12 17:20:33.000000000 +0100 -+++ mytop 2009-09-12 20:59:45.000000000 +0100 -@@ -156,7 +156,7 @@ - "idle|i" => \$config{idle}, - "resolve|r" => \$config{resolve}, - "prompt!" => \$config{prompt}, -- "long|!" => \$config{long_nums}, -+ "long!" => \$config{long_nums}, - "mode|m=s" => \$config{mode}, - "sort=s" => \$config{sort}, - ); -@@ -719,7 +719,7 @@ - ## - if ($config{header}) - { -- my @recs = Hashes("show status"); -+ my @recs = Hashes("SHOW /*!50002 GLOBAL */ STATUS"); - - ## if the server died or we lost connectivity - if (not @recs) -@@ -828,7 +828,7 @@ - $lines_left--; - - -- printf " Queries: %-5s qps: %4.0f Slow: %7s Se/In/Up/De(%%): %02.0f/%02.0f/%02.0f/%02.0f \n", -+ printf " Queries: %-6s qps: %4.0f Slow: %7s Se/In/Up/De(%%): %02.0f/%02.0f/%02.0f/%02.0f \n", - make_short( $STATUS{Questions} ), # q total - $STATUS{Questions} / $STATUS{Uptime}, # qps, average - make_short( $STATUS{Slow_queries} ), # slow -- cgit v1.2.3