Bug #37274 client 'status' command doesn't print all info after losing connection to server
Submitted: 9 Jun 2008 7:34 Modified: 17 Jul 2009 2:59
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.0.64, 5.1.24 OS:Any
Assigned to: Kristofer Pettersson
Tags: Contribution
Triage: Triaged: D3 (Medium)

[9 Jun 2008 7:34] Shane Bester
Description:
mysql> status
--------------
mysql  Ver 14.12 Distrib 5.0.52, for Win64 (unknown)

Connection id:          25
Current database:       test
Current user:           root@
SSL:                    Not in use
Using delimiter:        ;
Server version:         5.0.60-enterprise-gpl-nt MySQL Enterprise Server (GPL)
Protocol version:       10
Connection:             localhost via TCP/IP
Server characterset:    latin1
Db     characterset:    latin1
Client characterset:    latin1
Conn.  characterset:    latin1
TCP port:               3306
Uptime:                 2 hours 14 min 12 sec

Threads: 1  Questions: 1108512  Slow queries: 0  Opens: 7749  Flush tables: 1  Open tables: 0  Queries per second avg: 137.669
--------------

mysql> status
--------------
mysql  Ver 14.12 Distrib 5.0.52, for Win64 (unknown)

Connection id:          25
SSL:                    Not in use
Using delimiter:        ;
Server version:         5.0.60-enterprise-gpl-nt MySQL Enterprise Server (GPL)
Protocol version:       10
Connection:             localhost via TCP/IP
Client characterset:    latin1
Server characterset:    latin1
TCP port:               3306

How to repeat:
connect to server with command line client.
run 'status'

note the last line with stats about status.(Threads: 1  Questions: 1108512 ..)

shutdown and restart mysqld server.

in the same client session, run 'status' again.  now that status information on last line isn't there.

Suggested fix:
reconnect to server and get the status information?
[9 Jun 2008 13:38] Susanne Ebrecht
verified as described by using bzr tree.
[27 Apr 2009 3:00] Andrew Hutchings
A fix for this bug

Attachment: mysql-5.1.34-bug-37274.diff (application/octet-stream, text), 747 bytes.

[27 Apr 2009 3:07] Andrew Hutchings
Correct patch this time (sorry)

Attachment: mysql-5.1.34-bug-37274.diff (application/octet-stream, text), 697 bytes.

[3 Jul 2009 11:59] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/77891

2994 Kristofer Pettersson	2009-07-03
      Bug#37274 client 'status' command doesn't print all info after losing connection to
                server
      
      If the server connection was lost during repeated status commands,
      the client would fail to detect this and the client output would be inconsistent.
      
      This patch fixes this issue by making sure that the server is online
      before the client attempts to execute the status command.
     @ client/mysql.cc
        * Replace variable "connected" with a call to mysql_real_query_for_lazy()
          will attempt to reconnect to server on if there is a failure.
[8 Jul 2009 13:30] Bugs System
Pushed into 5.1.37 (revid:joro@sun.com-20090708131116-kyz8iotbum8w9yic) (version source revid:kristofer.pettersson@sun.com-20090703184930-z5tqsali969vzjen) (merge vers: 5.1.37) (pib:11)
[9 Jul 2009 7:37] Bugs System
Pushed into 5.1.37 (revid:joro@sun.com-20090708131116-kyz8iotbum8w9yic) (version source revid:kristofer.pettersson@sun.com-20090703184930-z5tqsali969vzjen) (merge vers: 5.1.37) (pib:11)
[10 Jul 2009 11:21] Bugs System
Pushed into 5.4.4-alpha (revid:anozdrin@bk-internal.mysql.com-20090710111017-bnh2cau84ug1hvei) (version source revid:kristofer.pettersson@sun.com-20090703185844-vbg4cykmfxu11kou) (merge vers: 5.4.4-alpha) (pib:11)
[17 Jul 2009 2:59] Paul Dubois
Noted in 5.1.37, 5.4.4 changelogs.

In the mysql client, if the server connection was lost during
repeated status commands, the client would fail to detect this and
command output would be inconsistent.
[12 Aug 2009 22:54] Paul Dubois
Noted in 5.4.2 changelog because next 5.4 version will be 5.4.2 and not 5.4.4.
[15 Aug 2009 2:11] Paul Dubois
Ignore previous comment about 5.4.2.
[26 Aug 2009 13:46] Bugs System
Pushed into 5.1.37-ndb-7.0.8 (revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (version source revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (merge vers: 5.1.37-ndb-7.0.8) (pib:11)
[26 Aug 2009 13:46] Bugs System
Pushed into 5.1.37-ndb-6.3.27 (revid:jonas@mysql.com-20090826105955-bkj027t47gfbamnc) (version source revid:jonas@mysql.com-20090826105955-bkj027t47gfbamnc) (merge vers: 5.1.37-ndb-6.3.27) (pib:11)
[26 Aug 2009 13:48] Bugs System
Pushed into 5.1.37-ndb-6.2.19 (revid:jonas@mysql.com-20090825194404-37rtosk049t9koc4) (version source revid:jonas@mysql.com-20090825194404-37rtosk049t9koc4) (merge vers: 5.1.37-ndb-6.2.19) (pib:11)
[27 Aug 2009 16:33] Bugs System
Pushed into 5.1.35-ndb-7.1.0 (revid:magnus.blaudd@sun.com-20090827163030-6o3kk6r2oua159hr) (version source revid:jonas@mysql.com-20090826132541-yablppc59e3yb54l) (merge vers: 5.1.37-ndb-7.0.8) (pib:11)
[8 Oct 2009 20:14] Paul Dubois
The 5.4 fix has been pushed to 5.4.2.