Add-comments-on-MinimalTupleSlots-usage.patch
application/octet-stream
Filename: Add-comments-on-MinimalTupleSlots-usage.patch
Type: application/octet-stream
Part: 0
Message:
Re: Table AM Interface Enhancements
Patch
Format: format-patch
Subject: Add comments on MinimalTupleSlots usage.
| File | + | − |
|---|---|---|
| src/backend/executor/execTuples.c | 10 | 1 |
From d3614733cf7904edc3040c6fe140ea1e75544529 Mon Sep 17 00:00:00 2001
From: Pavel Borisov <pashkin.elfe@gmail.com>
Date: Fri, 22 Mar 2024 08:41:20 +0400
Subject: [PATCH] Add comments on MinimalTupleSlots usage.
Also refine error message introduced in 0997e0af273d80add
---
src/backend/executor/execTuples.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/backend/executor/execTuples.c b/src/backend/executor/execTuples.c
index 7a7c786041..0ae240ced4 100644
--- a/src/backend/executor/execTuples.c
+++ b/src/backend/executor/execTuples.c
@@ -549,6 +549,10 @@ tts_minimal_getsomeattrs(TupleTableSlot *slot, int natts)
slot_deform_heap_tuple(slot, mslot->tuple, &mslot->off, natts);
}
+/*
+ * MinimalTupleTableSlots never provide system attributes. We generally
+ * shouldn't get here, but provide a user-friendly message if we do.
+ */
static Datum
tts_minimal_getsysattr(TupleTableSlot *slot, int attnum, bool *isnull)
{
@@ -561,6 +565,11 @@ tts_minimal_getsysattr(TupleTableSlot *slot, int attnum, bool *isnull)
return 0; /* silence compiler warnings */
}
+/*
+ * Within MinimalTuple abstraction transaction information is unavailable.
+ * We generally shouldn't get here, but provide a user-friendly message if
+ * we do.
+ */
static bool
tts_minimal_is_current_xact_tuple(TupleTableSlot *slot)
{
@@ -568,7 +577,7 @@ tts_minimal_is_current_xact_tuple(TupleTableSlot *slot)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
- errmsg("don't have a storage tuple in this context")));
+ errmsg("don't have transaction information for this type of tuple")));
return false; /* silence compiler warnings */
}
--
2.39.2 (Apple Git-143)