1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-02 04:21:28 +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

@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/storage/smgr/smgr.c,v 1.96 2006/03/05 15:58:39 momjian Exp $
* $PostgreSQL: pgsql/src/backend/storage/smgr/smgr.c,v 1.97 2006/03/24 04:32:13 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -942,7 +942,7 @@ smgr_redo(XLogRecPtr lsn, XLogRecord *record)
}
void
smgr_desc(char *buf, uint8 xl_info, char *rec)
smgr_desc(StringInfo buf, uint8 xl_info, char *rec)
{
uint8 info = xl_info & ~XLR_INFO_MASK;
@@ -950,7 +950,7 @@ smgr_desc(char *buf, uint8 xl_info, char *rec)
{
xl_smgr_create *xlrec = (xl_smgr_create *) rec;
sprintf(buf + strlen(buf), "file create: %u/%u/%u",
appendStringInfo(buf, "file create: %u/%u/%u",
xlrec->rnode.spcNode, xlrec->rnode.dbNode,
xlrec->rnode.relNode);
}
@@ -958,10 +958,10 @@ smgr_desc(char *buf, uint8 xl_info, char *rec)
{
xl_smgr_truncate *xlrec = (xl_smgr_truncate *) rec;
sprintf(buf + strlen(buf), "file truncate: %u/%u/%u to %u blocks",
appendStringInfo(buf, "file truncate: %u/%u/%u to %u blocks",
xlrec->rnode.spcNode, xlrec->rnode.dbNode,
xlrec->rnode.relNode, xlrec->blkno);
}
else
strcat(buf, "UNKNOWN");
appendStringInfo(buf, "UNKNOWN");
}