Bug #21428 "skipped 9 bytes from file: socket (3)" on "mysqladmin shutdown"
Submitted: 3 Aug 2006 11:50 Modified: 18 Dec 2006 18:49
Reporter: Hartmut Holzgraefe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.0.22, 5.0.24, 5.0bk OS:Linux (linux)
Assigned to: Michael Widenius CPU Architecture:Any

[3 Aug 2006 11:50] Hartmut Holzgraefe
Description:
When doing a "mysqladmin shutdown" on a server >=5.0.22 
the server shuts down fine but the client reports

 $ mysqladmin shutdown
 skipped 9 bytes from file: socket (3)

This is independant of the client binary version so its
not a client but a server problem.

(I'm using debug builds, haven't tested whether this 
 happens with non-debug binaries, too)

How to repeat:
Shut down a >=5.0.22 server with 

  mysqladmin shutdown
[3 Aug 2006 11:57] Magnus BlÄudd
Could be expected that the client discards some bytes before sending the command to the server.
[3 Aug 2006 12:03] Valeriy Kravchuk
Non-debug 5.0.25-BK does not demonstrate this behaviour:

openxs@suse:~/dbs/5.0> bin/mysqladmin -uroot shutdown
STOPPING server from pid file /home/openxs/dbs/5.0/var/suse.pid
060803 13:02:10  mysqld ended

[1]+  Done                    bin/mysqld_safe
openxs@suse:~/dbs/5.0> tail var/suse.err
060803 12:57:34 [Note] /home/openxs/dbs/5.0/libexec/mysqld: ready for connection
s.
Version: '5.0.25'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution
060803 13:02:07 [Note] /home/openxs/dbs/5.0/libexec/mysqld: Normal shutdown

060803 13:02:07  InnoDB: Starting shutdown...
060803 13:02:10  InnoDB: Shutdown completed; log sequence number 0 1686575588
060803 13:02:10 [Note] /home/openxs/dbs/5.0/libexec/mysqld: Shutdown complete

060803 13:02:10  mysqld ended
[3 Aug 2006 12:07] Valeriy Kravchuk
5.1.12-beta-debug does not demonstrate this behaviour also.
[3 Aug 2006 12:09] Valeriy Kravchuk
5.1.12-beta-debug does not demonstrate this behaviour also.
[3 Aug 2006 12:43] Valeriy Kravchuk
I was not able to repeat the behaviour described with 5.0.25-debug as well:

openxs@suse:~/dbs/5.0> bin/mysqld_safe --socket=/tmp/mysql5.sock &
[1] 12203
openxs@suse:~/dbs/5.0> Starting mysqld daemon with databases from /home/openxs/d
bs/5.0/var

openxs@suse:~/dbs/5.0> bin/mysql -uroot --socket=/tmp/mysql5.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.25-debug

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> exit
Bye
openxs@suse:~/dbs/5.0> bin/mysqladmin -uroot --socket=/tmp/mysql5.sock shutdown
STOPPING server from pid file /home/openxs/dbs/5.0/var/suse.pid
060803 13:32:51  mysqld ended

[1]+  Done                    bin/mysqld_safe --socket=/tmp/mysql5.sock

What am I doing wrong?
[3 Sep 2006 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[4 Sep 2006 8:23] Sergei Golubchik
You need to build with -DEXTRA_DEBUG to see it.
It's caused by double send_eof(thd); in 
dispatch_command(), case COM_SHUTDOWN. The second eof packet is those "9 bytes" that are ignored.
[30 Nov 2006 1:41] 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/16181

ChangeSet@1.2380, 2006-11-30 03:40:42+02:00, monty@mysql.com +63 -0
  Fixed compiler warnings (Mostly VC++):
  - Removed not used variables
  - Changed some ulong parameters/variables to ulonglong (possible serious bug)
  - Added casts to get rid of safe assignment from longlong to long (and similar)
  - Added casts to function parameters
  - Fixed signed/unsigned compares
  - Added some constructores to structures
  - Removed some not portable constructs
  
  Better fix for bug Bug #21428 "skipped 9 bytes from file: socket (3)" on "mysqladmin shutdown"
  (Added new parameter to net_clear() to define when we want the communication buffer to be emptied)
[7 Dec 2006 14:08] Michael Widenius
Fix will be in 5.1.14

This will not be fixed in 5.0, as it only affects DBUG builds (and are thus not critical)
[18 Dec 2006 18:49] Paul DuBois
Noted in 5.1.14 changelog.

For debug builds, mysqladmin shutdown displayed an extraneous "skipped
9 bytes from file: socket (3)" message.