fix_outdated_comments_regarding_tupletableslots_v2.patch

application/octet-stream

Filename: fix_outdated_comments_regarding_tupletableslots_v2.patch
Type: application/octet-stream
Part: 0
Message: Re: A structure has changed but comment modifications maybe missed

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
Series: patch v2
File+
src/backend/executor/execTuples.c 5 4
src/include/executor/tuptable.h 5 5
diff --git a/src/backend/executor/execTuples.c b/src/backend/executor/execTuples.c
index 9f18d46081..fda20ec318 100644
--- a/src/backend/executor/execTuples.c
+++ b/src/backend/executor/execTuples.c
@@ -385,8 +385,8 @@ tts_heap_materialize(TupleTableSlot *slot)
 	{
 		/*
 		 * The tuple contained in this slot is not allocated in the memory
-		 * context of the given slot (else it would have TTS_SHOULDFREE set).
-		 * Copy the tuple into the given slot's memory context.
+		 * context of the given slot (else it would have TTS_FLAG_SHOULDFREE
+		 * set).  Copy the tuple into the given slot's memory context.
 		 */
 		hslot->tuple = heap_copytuple(hslot->tuple);
 	}
@@ -554,8 +554,9 @@ tts_minimal_materialize(TupleTableSlot *slot)
 	{
 		/*
 		 * The minimal tuple contained in this slot is not allocated in the
-		 * memory context of the given slot (else it would have TTS_SHOULDFREE
-		 * set).  Copy the minimal tuple into the given slot's memory context.
+		 * memory context of the given slot (else it would have
+		 * TTS_FLAG_SHOULDFREE set).  Copy the minimal tuple into the given
+		 * slot's memory context.
 		 */
 		mslot->mintuple = heap_copy_minimal_tuple(mslot->mintuple);
 	}
diff --git a/src/include/executor/tuptable.h b/src/include/executor/tuptable.h
index c61734a15d..2e13ecc3ff 100644
--- a/src/include/executor/tuptable.h
+++ b/src/include/executor/tuptable.h
@@ -68,8 +68,8 @@
  * A TupleTableSlot can also be "empty", indicated by flag TTS_FLAG_EMPTY set
  * in tts_flags, holding no valid data.  This is the only valid state for a
  * freshly-created slot that has not yet had a tuple descriptor assigned to
- * it.  In this state, TTS_SHOULDFREE should not be set in tts_flags, tts_tuple
- * must be NULL and tts_nvalid zero.
+ * it.  In this state, TTS_FLAG_SHOULDFREE should not be set in tts_flags and
+ * tts_nvalid should be set to zero.
  *
  * The tupleDescriptor is simply referenced, not copied, by the TupleTableSlot
  * code.  The caller of ExecSetSlotDescriptor() is responsible for providing
@@ -79,8 +79,8 @@
  * mechanism to do more.  However, the slot will increment the tupdesc
  * reference count if a reference-counted tupdesc is supplied.)
  *
- * When TTS_SHOULDFREE is set in tts_flags, the physical tuple is "owned" by
- * the slot and should be freed when the slot's reference to the tuple is
+ * When TTS_FLAG_SHOULDFREE is set in tts_flags, the physical tuple is "owned"
+ * by the slot and should be freed when the slot's reference to the tuple is
  * dropped.
  *
  * tts_values/tts_isnull are allocated either when the slot is created (when
@@ -268,7 +268,7 @@ typedef struct BufferHeapTupleTableSlot
 	 * If buffer is not InvalidBuffer, then the slot is holding a pin on the
 	 * indicated buffer page; drop the pin when we release the slot's
 	 * reference to that buffer.  (TTS_FLAG_SHOULDFREE should not be set in
-	 * such a case, since presumably tts_tuple is pointing into the buffer.)
+	 * such a case, since presumably base.tuple is pointing into the buffer.)
 	 */
 	Buffer		buffer;			/* tuple's buffer, or InvalidBuffer */
 } BufferHeapTupleTableSlot;