diff --git a/client/conn.go b/client/conn.go index e26680f16..5d7845aa1 100644 --- a/client/conn.go +++ b/client/conn.go @@ -102,6 +102,11 @@ func (c *Conn) handshake() error { } func (c *Conn) Close() error { + if err := c.writeCommand(COM_QUIT); err != nil { + c.Conn.Close() + return errors.Trace(err) + } + return c.Conn.Close() }