mirror of
https://github.com/postgres/postgres.git
synced 2025-10-25 13:17:41 +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:
@@ -76,10 +76,10 @@ typedef struct xl_brin_insert
|
||||
typedef struct xl_brin_update
|
||||
{
|
||||
ItemPointerData oldtid;
|
||||
xl_brin_insert new;
|
||||
xl_brin_insert insert;
|
||||
} xl_brin_update;
|
||||
|
||||
#define SizeOfBrinUpdate (offsetof(xl_brin_update, new) + SizeOfBrinInsert)
|
||||
#define SizeOfBrinUpdate (offsetof(xl_brin_update, insert) + SizeOfBrinInsert)
|
||||
|
||||
/* This is what we need to know about a BRIN tuple samepage update */
|
||||
typedef struct xl_brin_samepage_update
|
||||
|
||||
Reference in New Issue
Block a user