From 81c766b3fd41c78c634d78ebae8d316808dfc630 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Fri, 5 Aug 2016 11:57:00 -0400 Subject: [PATCH] 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. --- src/backend/access/heap/tuptoaster.c | 2 +- src/include/utils/tqual.h | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/backend/access/heap/tuptoaster.c b/src/backend/access/heap/tuptoaster.c index 55b6b41f8c..31b0132b42 100644 --- a/src/backend/access/heap/tuptoaster.c +++ b/src/backend/access/heap/tuptoaster.c @@ -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); } diff --git a/src/include/utils/tqual.h b/src/include/utils/tqual.h index 8041e7b67f..fc7328c1e2 100644 --- a/src/include/utils/tqual.h +++ b/src/include/utils/tqual.h @@ -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 */ -- 2.40.0