()
| 1593 | } |
| 1594 | |
| 1595 | func (mrr *MultiResultReader) receiveMessage() (pgproto3.BackendMessage, error) { |
| 1596 | msg, err := mrr.pgConn.receiveMessage() |
| 1597 | if err != nil { |
| 1598 | mrr.pgConn.contextWatcher.Unwatch() |
| 1599 | mrr.err = normalizeTimeoutError(mrr.ctx, err) |
| 1600 | mrr.closed = true |
| 1601 | mrr.pgConn.asyncClose() |
| 1602 | return nil, mrr.err |
| 1603 | } |
| 1604 | |
| 1605 | switch msg := msg.(type) { |
| 1606 | case *pgproto3.ReadyForQuery: |
| 1607 | mrr.closed = true |
| 1608 | mrr.pgConn.contextWatcher.Unwatch() |
| 1609 | mrr.pgConn.unlock() |
| 1610 | case *pgproto3.ErrorResponse: |
| 1611 | mrr.err = ErrorResponseToPgError(msg) |
| 1612 | } |
| 1613 | |
| 1614 | return msg, nil |
| 1615 | } |
| 1616 | |
| 1617 | // NextResult returns advances the MultiResultReader to the next result and returns true if a result is available. |
| 1618 | func (mrr *MultiResultReader) NextResult() bool { |
no test coverage detected