1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +03:00

Arrange to emit a description of the current XLOG record as error context

when an error occurs during xlog replay.  Also, replace the former risky
'write into a fixed-size buffer with no overflow detection' API for XLOG
record description routines; use an expansible StringInfo instead.  (The
latter accounts for most of the patch bulk.)

Qingqing Zhou
This commit is contained in:
Tom Lane
2006-03-24 04:32:13 +00:00
parent 4fb92718be
commit 0a20207060
25 changed files with 198 additions and 160 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/sequence.c,v 1.129 2006/03/14 22:48:18 tgl Exp $
* $PostgreSQL: pgsql/src/backend/commands/sequence.c,v 1.130 2006/03/24 04:32:13 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -1170,19 +1170,19 @@ seq_redo(XLogRecPtr lsn, XLogRecord *record)
}
void
seq_desc(char *buf, uint8 xl_info, char *rec)
seq_desc(StringInfo buf, uint8 xl_info, char *rec)
{
uint8 info = xl_info & ~XLR_INFO_MASK;
xl_seq_rec *xlrec = (xl_seq_rec *) rec;
if (info == XLOG_SEQ_LOG)
strcat(buf, "log: ");
appendStringInfo(buf, "log: ");
else
{
strcat(buf, "UNKNOWN");
appendStringInfo(buf, "UNKNOWN");
return;
}
sprintf(buf + strlen(buf), "rel %u/%u/%u",
appendStringInfo(buf, "rel %u/%u/%u",
xlrec->node.spcNode, xlrec->node.dbNode, xlrec->node.relNode);
}