1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-16 06:01:02 +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

@ -15,7 +15,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.177 2006/03/05 15:58:24 momjian Exp $
* $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.178 2006/03/24 04:32:13 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -1392,7 +1392,7 @@ dbase_redo(XLogRecPtr lsn, XLogRecord *record)
}
void
dbase_desc(char *buf, uint8 xl_info, char *rec)
dbase_desc(StringInfo buf, uint8 xl_info, char *rec)
{
uint8 info = xl_info & ~XLR_INFO_MASK;
@ -1400,7 +1400,7 @@ dbase_desc(char *buf, uint8 xl_info, char *rec)
{
xl_dbase_create_rec *xlrec = (xl_dbase_create_rec *) rec;
sprintf(buf + strlen(buf), "create db: copy dir %u/%u to %u/%u",
appendStringInfo(buf, "create db: copy dir %u/%u to %u/%u",
xlrec->src_db_id, xlrec->src_tablespace_id,
xlrec->db_id, xlrec->tablespace_id);
}
@ -1408,9 +1408,9 @@ dbase_desc(char *buf, uint8 xl_info, char *rec)
{
xl_dbase_drop_rec *xlrec = (xl_dbase_drop_rec *) rec;
sprintf(buf + strlen(buf), "drop db: dir %u/%u",
appendStringInfo(buf, "drop db: dir %u/%u",
xlrec->db_id, xlrec->tablespace_id);
}
else
strcat(buf, "UNKNOWN");
appendStringInfo(buf, "UNKNOWN");
}