Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 81c766b

Browse files
committed
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.
1 parent e7caacf commit 81c766b

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/backend/access/heap/tuptoaster.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2316,5 +2316,5 @@ init_toast_snapshot(Snapshot toast_snapshot)
23162316
if (snapshot == NULL)
23172317
elog(ERROR, "no known snapshots");
23182318

2319-
InitToastSnapshot(toast_snapshot, snapshot->lsn, snapshot->whenTaken);
2319+
InitToastSnapshot(*toast_snapshot, snapshot->lsn, snapshot->whenTaken);
23202320
}

src/include/utils/tqual.h

+4-7
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,9 @@ extern bool ResolveCminCmaxDuringDecoding(struct HTAB *tuplecid_data,
104104
* Similarly, some initialization is required for SnapshotToast. We need
105105
* to set lsn and whenTaken correctly to support snapshot_too_old.
106106
*/
107-
static inline void
108-
InitToastSnapshot(Snapshot snapshot, XLogRecPtr lsn, int64 whenTaken)
109-
{
110-
snapshot->satisfies = HeapTupleSatisfiesToast;
111-
snapshot->lsn = lsn;
112-
snapshot->whenTaken = whenTaken;
113-
}
107+
#define InitToastSnapshot(snapshotdata, l, w) \
108+
((snapshotdata).satisfies = HeapTupleSatisfiesDirty, \
109+
(snapshotdata).lsn = (l), \
110+
(snapshotdata).whenTaken = (w))
114111

115112
#endif /* TQUAL_H */

0 commit comments

Comments
 (0)