(mysqlConn *client.Conn, err error, pool *client.Pool)
| 169 | } |
| 170 | |
| 171 | func (m *mysqlProxy) pushConn(mysqlConn *client.Conn, err error, pool *client.Pool) { |
| 172 | if errors.Is(err, mysql.ErrBadConn) { |
| 173 | mysqlConn.Close() |
| 174 | return |
| 175 | } |
| 176 | if mysqlConn.IsInTransaction() { |
| 177 | return |
| 178 | } |
| 179 | if err != nil { |
| 180 | if err := mysqlConn.Rollback(); err != nil { |
| 181 | mysqlConn.Close() |
| 182 | return |
| 183 | } |
| 184 | } |
| 185 | if mysqlConn.IOErr() != nil { |
| 186 | mysqlConn.Close() |
| 187 | return |
| 188 | } |
| 189 | if mysqlConn.Conn != nil { |
| 190 | pool.PutConn(mysqlConn) |
| 191 | } |
| 192 | } |
no test coverage detected