Description of problem: mytop doesn't show proper statistics with more recent MySQL server versions. How reproducible: always Steps to Reproduce: 1. Run mytop with a MySQL server 5.0.2 or newer. Actual results: qps and similar statistics are zero. Expected results: The statistics should have meaningful values. Additional info: This is due to a change in MySQL's SHOW STATUS. http://dev.mysql.com/doc/refman/5.0/en/show-status.html Below is a patch that fixes the problem. The use of version comments should make mytop still work with older MySQL servers. --- mytop.orig 2009-07-26 21:08:12.000000000 -0700 +++ mytop 2010-03-27 10:25:16.000000000 -0700 @@ -265,7 +265,7 @@ my $db_version; my $have_query_cache; -my @variables = Hashes("show variables"); +my @variables = Hashes("show /*!50002 global */ variables"); foreach (@variables) { @@ -710,7 +710,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) @@ -755,7 +755,7 @@ ## Query Cache info ## - ## mysql> show status like 'qcache%'; + ## mysql> show /*!50002 global */ status like 'qcache%'; ## +-------------------------+----------+ ## | Variable_name | Value | ## +-------------------------+----------+ @@ -1064,7 +1064,7 @@ sub GetQPS() { - my($data) = Hashes('SHOW STATUS LIKE "Questions"'); + my($data) = Hashes('SHOW /*!50002 GLOBAL */ STATUS LIKE "Questions"'); my $num = $data->{Value}; if (not defined $questions) ## first time? @@ -1126,7 +1126,7 @@ } # Variable_name and Value pairs come back... - my @data = Hashes("SHOW STATUS LIKE 'Com_%'"); + my @data = Hashes("SHOW /*!50002 GLOBAL */ STATUS LIKE 'Com_%'"); my %cmd_data; my %cmd_delta; my %cmd_pct; @@ -1197,7 +1197,7 @@ } } - my @rows = Hashes("SHOW VARIABLES"); + my @rows = Hashes("SHOW /*!50002 GLOBAL */ VARIABLES"); open P, "|$config{pager}" or die "$!"; @@ -1216,7 +1216,7 @@ sub GetShowStatus() { Clear() unless $config{batchmode}; - my @rows = Hashes("SHOW STATUS"); + my @rows = Hashes("SHOW /*!50002 GLOBAL */ STATUS"); printf "%32s %10s %10s\n", 'Counter', 'Total', 'Change'; printf "%32s %10s %10s\n", '-------', '-----', '------';
I have prepared a new package. Could you please perform a brief test. Package is available here: http://koji.fedoraproject.org/koji/buildinfo?buildID=164004 With direct link: http://kojipkgs.fedoraproject.org/packages/mytop/1.7/1.b737f60.fc12/noarch/mytop-1.7-1.b737f60.fc12.noarch.rpm Thanks in advance.
I downloaded and installed the new package. It displays statistics correctly with MySQL 5.1.44. Thanks for the quick response.
mytop-1.7-1.b737f60.fc12 has been submitted as an update for Fedora 12. http://admin.fedoraproject.org/updates/mytop-1.7-1.b737f60.fc12
mytop-1.7-1.b737f60.fc13 has been submitted as an update for Fedora 13. http://admin.fedoraproject.org/updates/mytop-1.7-1.b737f60.fc13
mytop-1.7-1.b737f60.fc11 has been submitted as an update for Fedora 11. http://admin.fedoraproject.org/updates/mytop-1.7-1.b737f60.fc11
mytop-1.7-1.b737f60.fc12 has been pushed to the Fedora 12 stable repository. If problems still persist, please make note of it in this bug report.
mytop-1.7-1.b737f60.fc11 has been pushed to the Fedora 11 stable repository. If problems still persist, please make note of it in this bug report.
mytop-1.7-1.b737f60.fc13 has been pushed to the Fedora 13 stable repository. If problems still persist, please make note of it in this bug report.