aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-09-27 15:04:08 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-09-27 15:04:08 +0000
commitcb253de21af4258b3f332df36347be8f060c0665 (patch)
tree76643ed7d374200629978a3a8155e4416876f10f /src
parent0b1b377569692ef85f46411854639ffd936505d6 (diff)
downloadpostgresql-cb253de21af4258b3f332df36347be8f060c0665.tar.gz
postgresql-cb253de21af4258b3f332df36347be8f060c0665.zip
Don't mess with HEAP_XMAX_INVALID in heaptuple.c routines; there is
no reason to worry about the tuple commit status bits until the tuple is inserted in a relation by heapam.c. Also, improve comments for heap_addheader().
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/common/heaptuple.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c
index 9901965a48f..470241e22ad 100644
--- a/src/backend/access/common/heaptuple.c
+++ b/src/backend/access/common/heaptuple.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.82 2002/09/04 20:31:08 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.83 2002/09/27 15:04:08 tgl Exp $
*
* NOTES
* The old interface functions have been converted to macros
@@ -617,6 +617,9 @@ heap_formtuple(TupleDesc tupleDescriptor,
td->t_natts = numberOfAttributes;
td->t_hoff = hoff;
+ if (tupleDescriptor->tdhasoid) /* else leave infomask = 0 */
+ td->t_infomask = HEAP_HASOID;
+
DataFill((char *) td + hoff,
tupleDescriptor,
value,
@@ -624,11 +627,6 @@ heap_formtuple(TupleDesc tupleDescriptor,
&td->t_infomask,
(hasnull ? td->t_bits : NULL));
- if (tupleDescriptor->tdhasoid)
- td->t_infomask |= HEAP_HASOID;
-
- td->t_infomask |= HEAP_XMAX_INVALID;
-
return tuple;
}
@@ -736,8 +734,12 @@ heap_freetuple(HeapTuple htup)
*
* This routine forms a HeapTuple by copying the given structure (tuple
* data) and adding a generic header. Note that the tuple data is
- * presumed to contain no null fields. It is typically only useful
- * for null-free system tables.
+ * presumed to contain no null fields and no varlena fields.
+ *
+ * This routine is really only useful for certain system tables that are
+ * known to be fixed-width and null-free. It is used in some places for
+ * pg_class, but that is a gross hack (it only works because relacl can
+ * be omitted from the tuple entirely in those places).
* ----------------
*/
HeapTuple
@@ -770,9 +772,11 @@ heap_addheader(int natts, /* max domain index */
MemSet((char *) td, 0, hoff);
- td->t_hoff = hoff;
td->t_natts = natts;
- td->t_infomask = withoid ? (HEAP_XMAX_INVALID | HEAP_HASOID) : HEAP_XMAX_INVALID;
+ td->t_hoff = hoff;
+
+ if (withoid) /* else leave infomask = 0 */
+ td->t_infomask = HEAP_HASOID;
memcpy((char *) td + hoff, structure, structlen);