Skip to content

Commit

Permalink
in function MySQLDriver.Open: replace errBadConnNoWrite with driver.E…
Browse files Browse the repository at this point in the history
…rrBadConn for resend while 'bad connection' happenning
  • Loading branch information
安佳玮 committed Oct 19, 2018
1 parent 361f66e commit c07f37b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ func (d MySQLDriver) Open(dsn string) (driver.Conn, error) {
}
if err = mc.writeHandshakeResponsePacket(authResp, addNUL, plugin); err != nil {
mc.cleanup()
return nil, err
// errBadConnNoWrite should be replaced with driver.ErrBadConn for resend
return nil, mc.markBadConn(err)
}

// Handle response to auth packet, switch methods if possible
Expand Down

0 comments on commit c07f37b

Please sign in to comment.