MCPcopy Create free account
hub / github.com/apache/cloudberry / XLogRecGetBlockData

Function XLogRecGetBlockData

src/backend/access/transam/xlogreader.c:1566–1588  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

1564 * pointer points to a MAXALIGNed buffer.
1565 */
1566char *
1567XLogRecGetBlockData(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.

Callers 15

DecodeInsertFunction · 0.85
DecodeUpdateFunction · 0.85
DecodeMultiInsertFunction · 0.85
ginRedoInsertFunction · 0.85
ginRedoUpdateMetapageFunction · 0.85
ginRedoInsertListPageFunction · 0.85
brin_xlog_insert_updateFunction · 0.85
gin_descFunction · 0.85
out_insertFunction · 0.85
btree_descFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected