summaryrefslogtreecommitdiff
path: root/src/backend/access/heap/heapam_visibility.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/heap/heapam_visibility.c')
-rw-r--r--src/backend/access/heap/heapam_visibility.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/backend/access/heap/heapam_visibility.c b/src/backend/access/heap/heapam_visibility.c
index e146605bd57..05f6946fe60 100644
--- a/src/backend/access/heap/heapam_visibility.c
+++ b/src/backend/access/heap/heapam_visibility.c
@@ -962,6 +962,15 @@ HeapTupleSatisfiesMVCC(HeapTuple htup, Snapshot snapshot,
{
HeapTupleHeader tuple = htup->t_data;
+ /*
+ * Assert that the caller has registered the snapshot. This function
+ * doesn't care about the registration as such, but in general you
+ * shouldn't try to use a snapshot without registration because it might
+ * get invalidated while it's still in use, and this is a convenient place
+ * to check for that.
+ */
+ Assert(snapshot->regd_count > 0 || snapshot->active_count > 0);
+
Assert(ItemPointerIsValid(&htup->t_self));
Assert(htup->t_tableOid != InvalidOid);