Change InitToastSnapshot to a macro.

tqual.h is included in some front-end compiles, and a static inline
breaks on buildfarm member castoroides.  Since the macro is never
referenced, it should dodge that problem, although this doesn't
seem like the cleanest way of hiding things from front-end compiles.

Report and review by Tom Lane; patch by me.
This commit is contained in:
Robert Haas 2016-08-05 11:57:00 -04:00
parent e7caacf733
commit 81c766b3fd
2 changed files with 5 additions and 8 deletions

View File

@ -2316,5 +2316,5 @@ init_toast_snapshot(Snapshot toast_snapshot)
if (snapshot == NULL)
elog(ERROR, "no known snapshots");
InitToastSnapshot(toast_snapshot, snapshot->lsn, snapshot->whenTaken);
InitToastSnapshot(*toast_snapshot, snapshot->lsn, snapshot->whenTaken);
}

View File

@ -104,12 +104,9 @@ extern bool ResolveCminCmaxDuringDecoding(struct HTAB *tuplecid_data,
* Similarly, some initialization is required for SnapshotToast. We need
* to set lsn and whenTaken correctly to support snapshot_too_old.
*/
static inline void
InitToastSnapshot(Snapshot snapshot, XLogRecPtr lsn, int64 whenTaken)
{
snapshot->satisfies = HeapTupleSatisfiesToast;
snapshot->lsn = lsn;
snapshot->whenTaken = whenTaken;
}
#define InitToastSnapshot(snapshotdata, l, w) \
((snapshotdata).satisfies = HeapTupleSatisfiesDirty, \
(snapshotdata).lsn = (l), \
(snapshotdata).whenTaken = (w))
#endif /* TQUAL_H */