markBadConn replaces errBadConnNoWrite with driver.ErrBadConn. This function is used to return driver.ErrBadConn only when safe to retry.
(err error)
| 129 | // markBadConn replaces errBadConnNoWrite with driver.ErrBadConn. |
| 130 | // This function is used to return driver.ErrBadConn only when safe to retry. |
| 131 | func (mc *mysqlConn) markBadConn(err error) error { |
| 132 | if err == errBadConnNoWrite { |
| 133 | return driver.ErrBadConn |
| 134 | } |
| 135 | return err |
| 136 | } |
| 137 | |
| 138 | func (mc *mysqlConn) Begin() (driver.Tx, error) { |
| 139 | return mc.begin(false) |