1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-23 14:01:44 +03:00

Change the signature of rm_desc so that it's passed a XLogRecord.

Just feels more natural, and is more consistent with rm_redo.
This commit is contained in:
Heikki Linnakangas
2014-06-14 10:46:48 +03:00
parent f3fdd257a4
commit 0ef0b6784c
37 changed files with 82 additions and 69 deletions

View File

@ -41,16 +41,17 @@ out_infobits(StringInfo buf, uint8 infobits)
}
void
heap_desc(StringInfo buf, uint8 xl_info, char *rec)
heap_desc(StringInfo buf, XLogRecord *record)
{
uint8 info = xl_info & ~XLR_INFO_MASK;
char *rec = XLogRecGetData(record);
uint8 info = record->xl_info & ~XLR_INFO_MASK;
info &= XLOG_HEAP_OPMASK;
if (info == XLOG_HEAP_INSERT)
{
xl_heap_insert *xlrec = (xl_heap_insert *) rec;
if (xl_info & XLOG_HEAP_INIT_PAGE)
if (record->xl_info & XLOG_HEAP_INIT_PAGE)
appendStringInfoString(buf, "insert(init): ");
else
appendStringInfoString(buf, "insert: ");
@ -69,7 +70,7 @@ heap_desc(StringInfo buf, uint8 xl_info, char *rec)
{
xl_heap_update *xlrec = (xl_heap_update *) rec;
if (xl_info & XLOG_HEAP_INIT_PAGE)
if (record->xl_info & XLOG_HEAP_INIT_PAGE)
appendStringInfoString(buf, "update(init): ");
else
appendStringInfoString(buf, "update: ");
@ -85,7 +86,7 @@ heap_desc(StringInfo buf, uint8 xl_info, char *rec)
{
xl_heap_update *xlrec = (xl_heap_update *) rec;
if (xl_info & XLOG_HEAP_INIT_PAGE) /* can this case happen? */
if (record->xl_info & XLOG_HEAP_INIT_PAGE) /* can this case happen? */
appendStringInfoString(buf, "hot_update(init): ");
else
appendStringInfoString(buf, "hot_update: ");
@ -126,9 +127,10 @@ heap_desc(StringInfo buf, uint8 xl_info, char *rec)
appendStringInfoString(buf, "UNKNOWN");
}
void
heap2_desc(StringInfo buf, uint8 xl_info, char *rec)
heap2_desc(StringInfo buf, XLogRecord *record)
{
uint8 info = xl_info & ~XLR_INFO_MASK;
char *rec = XLogRecGetData(record);
uint8 info = record->xl_info & ~XLR_INFO_MASK;
info &= XLOG_HEAP_OPMASK;
if (info == XLOG_HEAP2_CLEAN)
@ -172,7 +174,7 @@ heap2_desc(StringInfo buf, uint8 xl_info, char *rec)
{
xl_heap_multi_insert *xlrec = (xl_heap_multi_insert *) rec;
if (xl_info & XLOG_HEAP_INIT_PAGE)
if (record->xl_info & XLOG_HEAP_INIT_PAGE)
appendStringInfoString(buf, "multi-insert (init): ");
else
appendStringInfoString(buf, "multi-insert: ");