- 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 <m.seaman@infracaninophile.co.uk> (maintainer)
This commit is contained in:
Pav Lucistnik 2009-10-26 15:56:07 +00:00
parent e1f251b8a5
commit 1af61fa427
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=243344
2 changed files with 45 additions and 33 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= mytop
PORTVERSION= 1.6
PORTREVISION= 5
PORTREVISION= 6
CATEGORIES= databases
MASTER_SITES= http://jeremy.zawodny.com/mysql/mytop/

View File

@ -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