From b89ee54e20e722bb91f388667586a2e0986f197b Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Sat, 8 Nov 2014 00:31:03 -0300 Subject: Fix some coding issues in BRIN Reported by David Rowley: variadic macros are a problem. Get rid of them using a trick suggested by Tom Lane: add extra parentheses where needed. In the future we might decide we don't need the calls at all and remove them, but it seems appropriate to keep them while this code is still new. Also from David Rowley: brininsert() was trying to use a variable before initializing it. Fix by moving the brin_form_tuple call (which initializes the variable) to within the locked section. Reported by Peter Eisentraut: can't use "new" as a struct member name, because C++ compilers will choke on it, as reported by cpluspluscheck. --- src/backend/access/brin/brin_xlog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/backend/access/brin/brin_xlog.c') diff --git a/src/backend/access/brin/brin_xlog.c b/src/backend/access/brin/brin_xlog.c index 8dc80ad1e52..ebef984e7f1 100644 --- a/src/backend/access/brin/brin_xlog.c +++ b/src/backend/access/brin/brin_xlog.c @@ -144,7 +144,7 @@ brin_xlog_update(XLogRecPtr lsn, XLogRecord *record) /* First remove the old tuple */ blkno = ItemPointerGetBlockNumber(&(xlrec->oldtid)); - action = XLogReadBufferForRedo(lsn, record, 2, xlrec->new.node, + action = XLogReadBufferForRedo(lsn, record, 2, xlrec->insert.node, blkno, &buffer); if (action == BLK_NEEDS_REDO) { @@ -164,7 +164,7 @@ brin_xlog_update(XLogRecPtr lsn, XLogRecord *record) } /* Then insert the new tuple and update revmap, like in an insertion. */ - brin_xlog_insert_update(lsn, record, &xlrec->new, newtup); + brin_xlog_insert_update(lsn, record, &xlrec->insert, newtup); if (BufferIsValid(buffer)) UnlockReleaseBuffer(buffer); -- cgit v1.2.3