diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-03-24 04:32:13 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-03-24 04:32:13 +0000 |
| commit | 0a202070603bf38ce2e2fc11a7f897fc06603b80 (patch) | |
| tree | a856ccc9da2bf3ec6ec57da03788e27e89c22428 /src/backend/storage | |
| parent | 4fb92718be654b38652dfe893d075f3862e84eae (diff) | |
| download | postgresql-0a202070603bf38ce2e2fc11a7f897fc06603b80.tar.gz | |
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
Diffstat (limited to 'src/backend/storage')
| -rw-r--r-- | src/backend/storage/smgr/smgr.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/storage/smgr/smgr.c b/src/backend/storage/smgr/smgr.c index bdd2af4864..2ab1268ba1 100644 --- a/src/backend/storage/smgr/smgr.c +++ b/src/backend/storage/smgr/smgr.c @@ -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"); } |
