mirror of
https://github.com/postgres/postgres.git
synced 2025-06-23 14:01:44 +03:00
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:
@ -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);
|
||||
}
|
||||
|
@ -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 */
|
||||
|
Reference in New Issue
Block a user