* Returns the data associated with a block reference, or NULL if there is * no data (e.g. because a full-page image was taken instead). The returned * pointer points to a MAXALIGNed buffer. */
| 1564 | * pointer points to a MAXALIGNed buffer. |
| 1565 | */ |
| 1566 | char * |
| 1567 | XLogRecGetBlockData(XLogReaderState *record, uint8 block_id, Size *len) |
| 1568 | { |
| 1569 | DecodedBkpBlock *bkpb; |
| 1570 | |
| 1571 | if (!record->blocks[block_id].in_use) |
| 1572 | return NULL; |
| 1573 | |
| 1574 | bkpb = &record->blocks[block_id]; |
| 1575 | |
| 1576 | if (!bkpb->has_data) |
| 1577 | { |
| 1578 | if (len) |
| 1579 | *len = 0; |
| 1580 | return NULL; |
| 1581 | } |
| 1582 | else |
| 1583 | { |
| 1584 | if (len) |
| 1585 | *len = bkpb->data_len; |
| 1586 | return bkpb->data; |
| 1587 | } |
| 1588 | } |
| 1589 | |
| 1590 | /* |
| 1591 | * Restore a full-page image from a backup block attached to an XLOG record. |
no outgoing calls
no test coverage detected