( ctx context.Context, c *mysql.Conn, query string, callback mysql.ResultSpoolFn, )
| 54 | // replacement connection. The final pool close then retires the exact entry. |
| 55 | if h != nil && h.Handler != nil { |
| 56 | h.Handler.ConnectionClosed(c) |
| 57 | } |
| 58 | if h != nil && h.provider != nil && h.provider.Pool() != nil && c != nil && expectedConn != nil { |
| 59 | pool := h.provider.Pool() |
| 60 | if expectedTx != nil { |
| 61 | // First honor the complete pair. If SessionEnd already removed the old |
| 62 | // transaction, the nil-transaction binding close below may retire the |
| 63 | // generic connection, but only if it is still idle and identical. |
| 64 | _ = pool.CloseConnIfBinding(c.ConnectionID, expectedConn, expectedTx) |
| 65 | _ = pool.CloseConnIfBinding(c.ConnectionID, expectedConn, nil) |
| 66 | } else { |
| 67 | // The nil transaction is part of the identity check. A replacement |
| 68 | // transaction admitted after the initial snapshot therefore blocks this |
| 69 | // close instead of being rolled back by an unconditional connection close. |
nothing calls this directly
no test coverage detected