Commit 81c766b3 authored by Robert Haas's avatar Robert Haas

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.
parent e7caacf7
...@@ -2316,5 +2316,5 @@ init_toast_snapshot(Snapshot toast_snapshot) ...@@ -2316,5 +2316,5 @@ init_toast_snapshot(Snapshot toast_snapshot)
if (snapshot == NULL) if (snapshot == NULL)
elog(ERROR, "no known snapshots"); elog(ERROR, "no known snapshots");
InitToastSnapshot(toast_snapshot, snapshot->lsn, snapshot->whenTaken); InitToastSnapshot(*toast_snapshot, snapshot->lsn, snapshot->whenTaken);
} }
...@@ -104,12 +104,9 @@ extern bool ResolveCminCmaxDuringDecoding(struct HTAB *tuplecid_data, ...@@ -104,12 +104,9 @@ extern bool ResolveCminCmaxDuringDecoding(struct HTAB *tuplecid_data,
* Similarly, some initialization is required for SnapshotToast. We need * Similarly, some initialization is required for SnapshotToast. We need
* to set lsn and whenTaken correctly to support snapshot_too_old. * to set lsn and whenTaken correctly to support snapshot_too_old.
*/ */
static inline void #define InitToastSnapshot(snapshotdata, l, w) \
InitToastSnapshot(Snapshot snapshot, XLogRecPtr lsn, int64 whenTaken) ((snapshotdata).satisfies = HeapTupleSatisfiesDirty, \
{ (snapshotdata).lsn = (l), \
snapshot->satisfies = HeapTupleSatisfiesToast; (snapshotdata).whenTaken = (w))
snapshot->lsn = lsn;
snapshot->whenTaken = whenTaken;
}
#endif /* TQUAL_H */ #endif /* TQUAL_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment