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/access/transam/clog.c | |
parent | 4fb92718be654b38652dfe893d075f3862e84eae (diff) | |
download | postgresql-0a202070603bf38ce2e2fc11a7f897fc06603b80.tar.gz postgresql-0a202070603bf38ce2e2fc11a7f897fc06603b80.zip |
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/access/transam/clog.c')
-rw-r--r-- | src/backend/access/transam/clog.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/access/transam/clog.c b/src/backend/access/transam/clog.c index 82c259e7fb5..49f1e72c6c8 100644 --- a/src/backend/access/transam/clog.c +++ b/src/backend/access/transam/clog.c @@ -24,7 +24,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/backend/access/transam/clog.c,v 1.37 2006/03/05 15:58:21 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/access/transam/clog.c,v 1.38 2006/03/24 04:32:12 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -412,17 +412,17 @@ clog_redo(XLogRecPtr lsn, XLogRecord *record) } void -clog_desc(char *buf, uint8 xl_info, char *rec) +clog_desc(StringInfo buf, uint8 xl_info, char *rec) { - uint8 info = xl_info & ~XLR_INFO_MASK; + uint8 info = xl_info & ~XLR_INFO_MASK; if (info == CLOG_ZEROPAGE) { int pageno; memcpy(&pageno, rec, sizeof(int)); - sprintf(buf + strlen(buf), "zeropage: %d", pageno); + appendStringInfo(buf, "zeropage: %d", pageno); } else - strcat(buf, "UNKNOWN"); + appendStringInfo(buf, "UNKNOWN"); } |