|
@@ -72,7 +72,9 @@ func (d MySQLDriver) Open(dsn string) (driver.Conn, error) {
|
|
|
// Enable TCP Keepalives on TCP connections
|
|
// Enable TCP Keepalives on TCP connections
|
|
|
if tc, ok := mc.netConn.(*net.TCPConn); ok {
|
|
if tc, ok := mc.netConn.(*net.TCPConn); ok {
|
|
|
if err := tc.SetKeepAlive(true); err != nil {
|
|
if err := tc.SetKeepAlive(true); err != nil {
|
|
|
- mc.Close()
|
|
|
|
|
|
|
+ // Don't send COM_QUIT before handshake.
|
|
|
|
|
+ mc.netConn.Close()
|
|
|
|
|
+ mc.netConn = nil
|
|
|
return nil, err
|
|
return nil, err
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|