mirror of
https://github.com/postgres/postgres.git
synced 2025-11-07 19:06:32 +03:00
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.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user