Commit dd218ae7 authored by Tom Lane's avatar Tom Lane

Remove the t_datamcxt field of HeapTupleData. This was introduced for

the convenience of tuptoaster.c and is no longer needed, so may as well
get rid of some small amount of overhead.
parent 40314f2d
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/common/heaptuple.c,v 1.102 2005/10/19 22:30:30 tgl Exp $ * $PostgreSQL: pgsql/src/backend/access/common/heaptuple.c,v 1.103 2005/11/20 19:49:06 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -623,7 +623,6 @@ heap_copytuple(HeapTuple tuple) ...@@ -623,7 +623,6 @@ heap_copytuple(HeapTuple tuple)
newTuple->t_len = tuple->t_len; newTuple->t_len = tuple->t_len;
newTuple->t_self = tuple->t_self; newTuple->t_self = tuple->t_self;
newTuple->t_tableOid = tuple->t_tableOid; newTuple->t_tableOid = tuple->t_tableOid;
newTuple->t_datamcxt = CurrentMemoryContext;
newTuple->t_data = (HeapTupleHeader) ((char *) newTuple + HEAPTUPLESIZE); newTuple->t_data = (HeapTupleHeader) ((char *) newTuple + HEAPTUPLESIZE);
memcpy((char *) newTuple->t_data, (char *) tuple->t_data, tuple->t_len); memcpy((char *) newTuple->t_data, (char *) tuple->t_data, tuple->t_len);
return newTuple; return newTuple;
...@@ -647,7 +646,6 @@ heap_copytuple_with_tuple(HeapTuple src, HeapTuple dest) ...@@ -647,7 +646,6 @@ heap_copytuple_with_tuple(HeapTuple src, HeapTuple dest)
dest->t_len = src->t_len; dest->t_len = src->t_len;
dest->t_self = src->t_self; dest->t_self = src->t_self;
dest->t_tableOid = src->t_tableOid; dest->t_tableOid = src->t_tableOid;
dest->t_datamcxt = CurrentMemoryContext;
dest->t_data = (HeapTupleHeader) palloc(src->t_len); dest->t_data = (HeapTupleHeader) palloc(src->t_len);
memcpy((char *) dest->t_data, (char *) src->t_data, src->t_len); memcpy((char *) dest->t_data, (char *) src->t_data, src->t_len);
} }
...@@ -725,7 +723,6 @@ heap_form_tuple(TupleDesc tupleDescriptor, ...@@ -725,7 +723,6 @@ heap_form_tuple(TupleDesc tupleDescriptor,
* HeapTupleData management structure are allocated in one chunk. * HeapTupleData management structure are allocated in one chunk.
*/ */
tuple = (HeapTuple) palloc0(HEAPTUPLESIZE + len); tuple = (HeapTuple) palloc0(HEAPTUPLESIZE + len);
tuple->t_datamcxt = CurrentMemoryContext;
tuple->t_data = td = (HeapTupleHeader) ((char *) tuple + HEAPTUPLESIZE); tuple->t_data = td = (HeapTupleHeader) ((char *) tuple + HEAPTUPLESIZE);
/* /*
...@@ -833,7 +830,6 @@ heap_formtuple(TupleDesc tupleDescriptor, ...@@ -833,7 +830,6 @@ heap_formtuple(TupleDesc tupleDescriptor,
* HeapTupleData management structure are allocated in one chunk. * HeapTupleData management structure are allocated in one chunk.
*/ */
tuple = (HeapTuple) palloc0(HEAPTUPLESIZE + len); tuple = (HeapTuple) palloc0(HEAPTUPLESIZE + len);
tuple->t_datamcxt = CurrentMemoryContext;
tuple->t_data = td = (HeapTupleHeader) ((char *) tuple + HEAPTUPLESIZE); tuple->t_data = td = (HeapTupleHeader) ((char *) tuple + HEAPTUPLESIZE);
/* /*
...@@ -1516,11 +1512,6 @@ slot_attisnull(TupleTableSlot *slot, int attnum) ...@@ -1516,11 +1512,6 @@ slot_attisnull(TupleTableSlot *slot, int attnum)
void void
heap_freetuple(HeapTuple htup) heap_freetuple(HeapTuple htup)
{ {
if (htup->t_data != NULL)
if (htup->t_datamcxt != NULL && (char *) (htup->t_data) !=
((char *) htup + HEAPTUPLESIZE))
pfree(htup->t_data);
pfree(htup); pfree(htup);
} }
...@@ -1559,7 +1550,6 @@ heap_addheader(int natts, /* max domain index */ ...@@ -1559,7 +1550,6 @@ heap_addheader(int natts, /* max domain index */
len = hoff + structlen; len = hoff + structlen;
tuple = (HeapTuple) palloc0(HEAPTUPLESIZE + len); tuple = (HeapTuple) palloc0(HEAPTUPLESIZE + len);
tuple->t_datamcxt = CurrentMemoryContext;
tuple->t_data = td = (HeapTupleHeader) ((char *) tuple + HEAPTUPLESIZE); tuple->t_data = td = (HeapTupleHeader) ((char *) tuple + HEAPTUPLESIZE);
tuple->t_len = len; tuple->t_len = len;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.201 2005/11/20 18:38:20 tgl Exp $ * $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.202 2005/11/20 19:49:07 tgl Exp $
* *
* *
* INTERFACE ROUTINES * INTERFACE ROUTINES
...@@ -78,7 +78,6 @@ initscan(HeapScanDesc scan, ScanKey key) ...@@ -78,7 +78,6 @@ initscan(HeapScanDesc scan, ScanKey key)
*/ */
scan->rs_nblocks = RelationGetNumberOfBlocks(scan->rs_rd); scan->rs_nblocks = RelationGetNumberOfBlocks(scan->rs_rd);
scan->rs_ctup.t_datamcxt = NULL;
scan->rs_ctup.t_data = NULL; scan->rs_ctup.t_data = NULL;
scan->rs_cbuf = InvalidBuffer; scan->rs_cbuf = InvalidBuffer;
...@@ -129,8 +128,9 @@ heapgettup(Relation relation, ...@@ -129,8 +128,9 @@ heapgettup(Relation relation,
/* /*
* debugging stuff * debugging stuff
* *
* check validity of arguments, here and for other functions too Note: no * check validity of arguments, here and for other functions too
* locking manipulations needed--this is a local function *
* Note: no locking manipulations needed--this is a local function
*/ */
#ifdef HEAPDEBUGALL #ifdef HEAPDEBUGALL
if (ItemPointerIsValid(tid)) if (ItemPointerIsValid(tid))
...@@ -164,7 +164,6 @@ heapgettup(Relation relation, ...@@ -164,7 +164,6 @@ heapgettup(Relation relation,
if (BufferIsValid(*buffer)) if (BufferIsValid(*buffer))
ReleaseBuffer(*buffer); ReleaseBuffer(*buffer);
*buffer = InvalidBuffer; *buffer = InvalidBuffer;
tuple->t_datamcxt = NULL;
tuple->t_data = NULL; tuple->t_data = NULL;
return; return;
} }
...@@ -182,7 +181,6 @@ heapgettup(Relation relation, ...@@ -182,7 +181,6 @@ heapgettup(Relation relation,
if (BufferIsValid(*buffer)) if (BufferIsValid(*buffer))
ReleaseBuffer(*buffer); ReleaseBuffer(*buffer);
*buffer = InvalidBuffer; *buffer = InvalidBuffer;
tuple->t_datamcxt = NULL;
tuple->t_data = NULL; tuple->t_data = NULL;
return; return;
} }
...@@ -197,7 +195,6 @@ heapgettup(Relation relation, ...@@ -197,7 +195,6 @@ heapgettup(Relation relation,
lineoff = ItemPointerGetOffsetNumber(tid); lineoff = ItemPointerGetOffsetNumber(tid);
lpp = PageGetItemId(dp, lineoff); lpp = PageGetItemId(dp, lineoff);
tuple->t_datamcxt = NULL;
tuple->t_data = (HeapTupleHeader) PageGetItem((Page) dp, lpp); tuple->t_data = (HeapTupleHeader) PageGetItem((Page) dp, lpp);
tuple->t_len = ItemIdGetLength(lpp); tuple->t_len = ItemIdGetLength(lpp);
LockBuffer(*buffer, BUFFER_LOCK_UNLOCK); LockBuffer(*buffer, BUFFER_LOCK_UNLOCK);
...@@ -293,7 +290,6 @@ heapgettup(Relation relation, ...@@ -293,7 +290,6 @@ heapgettup(Relation relation,
{ {
bool valid; bool valid;
tuple->t_datamcxt = NULL;
tuple->t_data = (HeapTupleHeader) PageGetItem((Page) dp, lpp); tuple->t_data = (HeapTupleHeader) PageGetItem((Page) dp, lpp);
tuple->t_len = ItemIdGetLength(lpp); tuple->t_len = ItemIdGetLength(lpp);
ItemPointerSet(&(tuple->t_self), page, lineoff); ItemPointerSet(&(tuple->t_self), page, lineoff);
...@@ -340,7 +336,6 @@ heapgettup(Relation relation, ...@@ -340,7 +336,6 @@ heapgettup(Relation relation,
if (BufferIsValid(*buffer)) if (BufferIsValid(*buffer))
ReleaseBuffer(*buffer); ReleaseBuffer(*buffer);
*buffer = InvalidBuffer; *buffer = InvalidBuffer;
tuple->t_datamcxt = NULL;
tuple->t_data = NULL; tuple->t_data = NULL;
return; return;
} }
...@@ -872,7 +867,6 @@ heap_release_fetch(Relation relation, ...@@ -872,7 +867,6 @@ heap_release_fetch(Relation relation,
ReleaseBuffer(buffer); ReleaseBuffer(buffer);
*userbuf = InvalidBuffer; *userbuf = InvalidBuffer;
} }
tuple->t_datamcxt = NULL;
tuple->t_data = NULL; tuple->t_data = NULL;
return false; return false;
} }
...@@ -895,7 +889,6 @@ heap_release_fetch(Relation relation, ...@@ -895,7 +889,6 @@ heap_release_fetch(Relation relation,
ReleaseBuffer(buffer); ReleaseBuffer(buffer);
*userbuf = InvalidBuffer; *userbuf = InvalidBuffer;
} }
tuple->t_datamcxt = NULL;
tuple->t_data = NULL; tuple->t_data = NULL;
return false; return false;
} }
...@@ -903,7 +896,6 @@ heap_release_fetch(Relation relation, ...@@ -903,7 +896,6 @@ heap_release_fetch(Relation relation,
/* /*
* fill in *tuple fields * fill in *tuple fields
*/ */
tuple->t_datamcxt = NULL;
tuple->t_data = (HeapTupleHeader) PageGetItem((Page) dp, lp); tuple->t_data = (HeapTupleHeader) PageGetItem((Page) dp, lp);
tuple->t_len = ItemIdGetLength(lp); tuple->t_len = ItemIdGetLength(lp);
tuple->t_tableOid = RelationGetRelid(relation); tuple->t_tableOid = RelationGetRelid(relation);
...@@ -1027,7 +1019,6 @@ heap_get_latest_tid(Relation relation, ...@@ -1027,7 +1019,6 @@ heap_get_latest_tid(Relation relation,
/* OK to access the tuple */ /* OK to access the tuple */
tp.t_self = ctid; tp.t_self = ctid;
tp.t_datamcxt = NULL;
tp.t_data = (HeapTupleHeader) PageGetItem(dp, lp); tp.t_data = (HeapTupleHeader) PageGetItem(dp, lp);
tp.t_len = ItemIdGetLength(lp); tp.t_len = ItemIdGetLength(lp);
...@@ -1303,7 +1294,6 @@ heap_delete(Relation relation, ItemPointer tid, ...@@ -1303,7 +1294,6 @@ heap_delete(Relation relation, ItemPointer tid,
dp = (PageHeader) BufferGetPage(buffer); dp = (PageHeader) BufferGetPage(buffer);
lp = PageGetItemId(dp, ItemPointerGetOffsetNumber(tid)); lp = PageGetItemId(dp, ItemPointerGetOffsetNumber(tid));
tp.t_datamcxt = NULL;
tp.t_data = (HeapTupleHeader) PageGetItem(dp, lp); tp.t_data = (HeapTupleHeader) PageGetItem(dp, lp);
tp.t_len = ItemIdGetLength(lp); tp.t_len = ItemIdGetLength(lp);
tp.t_self = *tid; tp.t_self = *tid;
...@@ -1612,7 +1602,6 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup, ...@@ -1612,7 +1602,6 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
dp = (PageHeader) BufferGetPage(buffer); dp = (PageHeader) BufferGetPage(buffer);
lp = PageGetItemId(dp, ItemPointerGetOffsetNumber(otid)); lp = PageGetItemId(dp, ItemPointerGetOffsetNumber(otid));
oldtup.t_datamcxt = NULL;
oldtup.t_data = (HeapTupleHeader) PageGetItem(dp, lp); oldtup.t_data = (HeapTupleHeader) PageGetItem(dp, lp);
oldtup.t_len = ItemIdGetLength(lp); oldtup.t_len = ItemIdGetLength(lp);
oldtup.t_self = *otid; oldtup.t_self = *otid;
...@@ -2093,7 +2082,6 @@ heap_lock_tuple(Relation relation, HeapTuple tuple, Buffer *buffer, ...@@ -2093,7 +2082,6 @@ heap_lock_tuple(Relation relation, HeapTuple tuple, Buffer *buffer,
lp = PageGetItemId(dp, ItemPointerGetOffsetNumber(tid)); lp = PageGetItemId(dp, ItemPointerGetOffsetNumber(tid));
Assert(ItemIdIsUsed(lp)); Assert(ItemIdIsUsed(lp));
tuple->t_datamcxt = NULL;
tuple->t_data = (HeapTupleHeader) PageGetItem((Page) dp, lp); tuple->t_data = (HeapTupleHeader) PageGetItem((Page) dp, lp);
tuple->t_len = ItemIdGetLength(lp); tuple->t_len = ItemIdGetLength(lp);
tuple->t_tableOid = RelationGetRelid(relation); tuple->t_tableOid = RelationGetRelid(relation);
...@@ -2476,13 +2464,11 @@ heap_restrpos(HeapScanDesc scan) ...@@ -2476,13 +2464,11 @@ heap_restrpos(HeapScanDesc scan)
if (!ItemPointerIsValid(&scan->rs_mctid)) if (!ItemPointerIsValid(&scan->rs_mctid))
{ {
scan->rs_ctup.t_datamcxt = NULL;
scan->rs_ctup.t_data = NULL; scan->rs_ctup.t_data = NULL;
} }
else else
{ {
scan->rs_ctup.t_self = scan->rs_mctid; scan->rs_ctup.t_self = scan->rs_mctid;
scan->rs_ctup.t_datamcxt = NULL;
scan->rs_ctup.t_data = (HeapTupleHeader) 0x1; /* for heapgettup */ scan->rs_ctup.t_data = (HeapTupleHeader) 0x1; /* for heapgettup */
heapgettup(scan->rs_rd, heapgettup(scan->rs_rd,
0, 0,
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/heap/tuptoaster.c,v 1.54 2005/11/20 18:38:20 tgl Exp $ * $PostgreSQL: pgsql/src/backend/access/heap/tuptoaster.c,v 1.55 2005/11/20 19:49:07 tgl Exp $
* *
* *
* INTERFACE ROUTINES * INTERFACE ROUTINES
...@@ -774,7 +774,6 @@ toast_insert_or_update(Relation rel, HeapTuple newtup, HeapTuple oldtup) ...@@ -774,7 +774,6 @@ toast_insert_or_update(Relation rel, HeapTuple newtup, HeapTuple oldtup)
result_tuple->t_len = new_len; result_tuple->t_len = new_len;
result_tuple->t_self = newtup->t_self; result_tuple->t_self = newtup->t_self;
result_tuple->t_tableOid = newtup->t_tableOid; result_tuple->t_tableOid = newtup->t_tableOid;
result_tuple->t_datamcxt = CurrentMemoryContext;
new_data = (HeapTupleHeader) ((char *) result_tuple + HEAPTUPLESIZE); new_data = (HeapTupleHeader) ((char *) result_tuple + HEAPTUPLESIZE);
result_tuple->t_data = new_data; result_tuple->t_data = new_data;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/index/genam.c,v 1.49 2005/10/15 02:49:09 momjian Exp $ * $PostgreSQL: pgsql/src/backend/access/index/genam.c,v 1.50 2005/11/20 19:49:07 tgl Exp $
* *
* NOTES * NOTES
* many of the old access method routines have been turned into * many of the old access method routines have been turned into
...@@ -98,7 +98,6 @@ RelationGetIndexScan(Relation indexRelation, ...@@ -98,7 +98,6 @@ RelationGetIndexScan(Relation indexRelation,
ItemPointerSetInvalid(&scan->currentMarkData); ItemPointerSetInvalid(&scan->currentMarkData);
ItemPointerSetInvalid(&scan->xs_ctup.t_self); ItemPointerSetInvalid(&scan->xs_ctup.t_self);
scan->xs_ctup.t_datamcxt = NULL;
scan->xs_ctup.t_data = NULL; scan->xs_ctup.t_data = NULL;
scan->xs_cbuf = InvalidBuffer; scan->xs_cbuf = InvalidBuffer;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/trigger.c,v 1.195 2005/10/15 02:49:15 momjian Exp $ * $PostgreSQL: pgsql/src/backend/commands/trigger.c,v 1.196 2005/11/20 19:49:07 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1769,7 +1769,6 @@ ltrmark:; ...@@ -1769,7 +1769,6 @@ ltrmark:;
Assert(ItemIdIsUsed(lp)); Assert(ItemIdIsUsed(lp));
tuple.t_datamcxt = NULL;
tuple.t_data = (HeapTupleHeader) PageGetItem((Page) dp, lp); tuple.t_data = (HeapTupleHeader) PageGetItem((Page) dp, lp);
tuple.t_len = ItemIdGetLength(lp); tuple.t_len = ItemIdGetLength(lp);
tuple.t_self = *tid; tuple.t_self = *tid;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.317 2005/10/15 02:49:16 momjian Exp $ * $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.318 2005/11/20 19:49:07 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -1338,7 +1338,6 @@ scan_heap(VRelStats *vacrelstats, Relation onerel, ...@@ -1338,7 +1338,6 @@ scan_heap(VRelStats *vacrelstats, Relation onerel,
continue; continue;
} }
tuple.t_datamcxt = NULL;
tuple.t_data = (HeapTupleHeader) PageGetItem(page, itemid); tuple.t_data = (HeapTupleHeader) PageGetItem(page, itemid);
tuple.t_len = ItemIdGetLength(itemid); tuple.t_len = ItemIdGetLength(itemid);
ItemPointerSet(&(tuple.t_self), blkno, offnum); ItemPointerSet(&(tuple.t_self), blkno, offnum);
...@@ -1758,7 +1757,6 @@ repair_frag(VRelStats *vacrelstats, Relation onerel, ...@@ -1758,7 +1757,6 @@ repair_frag(VRelStats *vacrelstats, Relation onerel,
if (!ItemIdIsUsed(itemid)) if (!ItemIdIsUsed(itemid))
continue; continue;
tuple.t_datamcxt = NULL;
tuple.t_data = (HeapTupleHeader) PageGetItem(page, itemid); tuple.t_data = (HeapTupleHeader) PageGetItem(page, itemid);
tuple_len = tuple.t_len = ItemIdGetLength(itemid); tuple_len = tuple.t_len = ItemIdGetLength(itemid);
ItemPointerSet(&(tuple.t_self), blkno, offnum); ItemPointerSet(&(tuple.t_self), blkno, offnum);
...@@ -1937,7 +1935,6 @@ repair_frag(VRelStats *vacrelstats, Relation onerel, ...@@ -1937,7 +1935,6 @@ repair_frag(VRelStats *vacrelstats, Relation onerel,
break; break;
} }
/* OK, switch our attention to the next tuple in chain */ /* OK, switch our attention to the next tuple in chain */
tp.t_datamcxt = NULL;
tp.t_data = nextTdata; tp.t_data = nextTdata;
tp.t_self = nextTid; tp.t_self = nextTid;
tlen = tp.t_len = ItemIdGetLength(nextItemid); tlen = tp.t_len = ItemIdGetLength(nextItemid);
...@@ -2064,7 +2061,6 @@ repair_frag(VRelStats *vacrelstats, Relation onerel, ...@@ -2064,7 +2061,6 @@ repair_frag(VRelStats *vacrelstats, Relation onerel,
chain_move_failed = true; chain_move_failed = true;
break; /* out of check-all-items loop */ break; /* out of check-all-items loop */
} }
tp.t_datamcxt = NULL;
tp.t_data = PTdata; tp.t_data = PTdata;
tlen = tp.t_len = ItemIdGetLength(Pitemid); tlen = tp.t_len = ItemIdGetLength(Pitemid);
if (freeCbuf) if (freeCbuf)
...@@ -2122,7 +2118,6 @@ repair_frag(VRelStats *vacrelstats, Relation onerel, ...@@ -2122,7 +2118,6 @@ repair_frag(VRelStats *vacrelstats, Relation onerel,
Citemid = PageGetItemId(Cpage, Citemid = PageGetItemId(Cpage,
ItemPointerGetOffsetNumber(&(tuple.t_self))); ItemPointerGetOffsetNumber(&(tuple.t_self)));
tuple.t_datamcxt = NULL;
tuple.t_data = (HeapTupleHeader) PageGetItem(Cpage, Citemid); tuple.t_data = (HeapTupleHeader) PageGetItem(Cpage, Citemid);
tuple_len = tuple.t_len = ItemIdGetLength(Citemid); tuple_len = tuple.t_len = ItemIdGetLength(Citemid);
...@@ -2582,7 +2577,6 @@ move_chain_tuple(Relation rel, ...@@ -2582,7 +2577,6 @@ move_chain_tuple(Relation rel,
newitemid = PageGetItemId(dst_page, newoff); newitemid = PageGetItemId(dst_page, newoff);
/* drop temporary copy, and point to the version on the dest page */ /* drop temporary copy, and point to the version on the dest page */
pfree(newtup.t_data); pfree(newtup.t_data);
newtup.t_datamcxt = NULL;
newtup.t_data = (HeapTupleHeader) PageGetItem(dst_page, newitemid); newtup.t_data = (HeapTupleHeader) PageGetItem(dst_page, newitemid);
ItemPointerSet(&(newtup.t_self), dst_vacpage->blkno, newoff); ItemPointerSet(&(newtup.t_self), dst_vacpage->blkno, newoff);
...@@ -2692,7 +2686,6 @@ move_plain_tuple(Relation rel, ...@@ -2692,7 +2686,6 @@ move_plain_tuple(Relation rel,
dst_vacpage->offsets_used, dst_vacpage->offsets_free); dst_vacpage->offsets_used, dst_vacpage->offsets_free);
newitemid = PageGetItemId(dst_page, newoff); newitemid = PageGetItemId(dst_page, newoff);
pfree(newtup.t_data); pfree(newtup.t_data);
newtup.t_datamcxt = NULL;
newtup.t_data = (HeapTupleHeader) PageGetItem(dst_page, newitemid); newtup.t_data = (HeapTupleHeader) PageGetItem(dst_page, newitemid);
ItemPointerSet(&(newtup.t_data->t_ctid), dst_vacpage->blkno, newoff); ItemPointerSet(&(newtup.t_data->t_ctid), dst_vacpage->blkno, newoff);
newtup.t_self = newtup.t_data->t_ctid; newtup.t_self = newtup.t_data->t_ctid;
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.61 2005/10/15 02:49:16 momjian Exp $ * $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.62 2005/11/20 19:49:07 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -349,7 +349,6 @@ lazy_scan_heap(Relation onerel, LVRelStats *vacrelstats, ...@@ -349,7 +349,6 @@ lazy_scan_heap(Relation onerel, LVRelStats *vacrelstats,
continue; continue;
} }
tuple.t_datamcxt = NULL;
tuple.t_data = (HeapTupleHeader) PageGetItem(page, itemid); tuple.t_data = (HeapTupleHeader) PageGetItem(page, itemid);
tuple.t_len = ItemIdGetLength(itemid); tuple.t_len = ItemIdGetLength(itemid);
ItemPointerSet(&(tuple.t_self), blkno, offnum); ItemPointerSet(&(tuple.t_self), blkno, offnum);
...@@ -885,7 +884,6 @@ count_nondeletable_pages(Relation onerel, LVRelStats *vacrelstats) ...@@ -885,7 +884,6 @@ count_nondeletable_pages(Relation onerel, LVRelStats *vacrelstats)
if (!ItemIdIsUsed(itemid)) if (!ItemIdIsUsed(itemid))
continue; continue;
tuple.t_datamcxt = NULL;
tuple.t_data = (HeapTupleHeader) PageGetItem(page, itemid); tuple.t_data = (HeapTupleHeader) PageGetItem(page, itemid);
tuple.t_len = ItemIdGetLength(itemid); tuple.t_len = ItemIdGetLength(itemid);
ItemPointerSet(&(tuple.t_self), blkno, offnum); ItemPointerSet(&(tuple.t_self), blkno, offnum);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/nodeHash.c,v 1.96 2005/10/15 02:49:17 momjian Exp $ * $PostgreSQL: pgsql/src/backend/executor/nodeHash.c,v 1.97 2005/11/20 19:49:07 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -621,7 +621,6 @@ ExecHashTableInsert(HashJoinTable hashtable, ...@@ -621,7 +621,6 @@ ExecHashTableInsert(HashJoinTable hashtable,
memcpy((char *) &hashTuple->htup, memcpy((char *) &hashTuple->htup,
(char *) tuple, (char *) tuple,
sizeof(hashTuple->htup)); sizeof(hashTuple->htup));
hashTuple->htup.t_datamcxt = hashtable->batchCxt;
hashTuple->htup.t_data = (HeapTupleHeader) hashTuple->htup.t_data = (HeapTupleHeader)
(((char *) hashTuple) + MAXALIGN(sizeof(HashJoinTupleData))); (((char *) hashTuple) + MAXALIGN(sizeof(HashJoinTupleData)));
memcpy((char *) hashTuple->htup.t_data, memcpy((char *) hashTuple->htup.t_data,
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/executor/nodeHashjoin.c,v 1.75 2005/10/18 01:06:24 tgl Exp $ * $PostgreSQL: pgsql/src/backend/executor/nodeHashjoin.c,v 1.76 2005/11/20 19:49:07 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -789,7 +789,6 @@ ExecHashJoinGetSavedTuple(HashJoinState *hjstate, ...@@ -789,7 +789,6 @@ ExecHashJoinGetSavedTuple(HashJoinState *hjstate,
errmsg("could not read from hash-join temporary file: %m"))); errmsg("could not read from hash-join temporary file: %m")));
heapTuple = palloc(HEAPTUPLESIZE + htup.t_len); heapTuple = palloc(HEAPTUPLESIZE + htup.t_len);
memcpy((char *) heapTuple, (char *) &htup, sizeof(HeapTupleData)); memcpy((char *) heapTuple, (char *) &htup, sizeof(HeapTupleData));
heapTuple->t_datamcxt = CurrentMemoryContext;
heapTuple->t_data = (HeapTupleHeader) heapTuple->t_data = (HeapTupleHeader)
((char *) heapTuple + HEAPTUPLESIZE); ((char *) heapTuple + HEAPTUPLESIZE);
nread = BufFileRead(file, (void *) heapTuple->t_data, htup.t_len); nread = BufFileRead(file, (void *) heapTuple->t_data, htup.t_len);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.230 2005/10/15 02:49:31 momjian Exp $ * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.231 2005/11/20 19:49:07 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -2998,7 +2998,6 @@ load_relcache_init_file(void) ...@@ -2998,7 +2998,6 @@ load_relcache_init_file(void)
goto read_failed; goto read_failed;
/* Fix up internal pointers in the tuple -- see heap_copytuple */ /* Fix up internal pointers in the tuple -- see heap_copytuple */
rel->rd_indextuple->t_datamcxt = CurrentMemoryContext;
rel->rd_indextuple->t_data = (HeapTupleHeader) ((char *) rel->rd_indextuple + HEAPTUPLESIZE); rel->rd_indextuple->t_data = (HeapTupleHeader) ((char *) rel->rd_indextuple + HEAPTUPLESIZE);
rel->rd_index = (Form_pg_index) GETSTRUCT(rel->rd_indextuple); rel->rd_index = (Form_pg_index) GETSTRUCT(rel->rd_indextuple);
......
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/sort/tuplesort.c,v 1.54 2005/10/25 13:47:08 momjian Exp $ * $PostgreSQL: pgsql/src/backend/utils/sort/tuplesort.c,v 1.55 2005/11/20 19:49:08 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -2071,7 +2071,6 @@ readtup_heap(Tuplesortstate *state, int tapenum, unsigned int len) ...@@ -2071,7 +2071,6 @@ readtup_heap(Tuplesortstate *state, int tapenum, unsigned int len)
/* reconstruct the HeapTupleData portion */ /* reconstruct the HeapTupleData portion */
tuple->t_len = len - sizeof(unsigned int); tuple->t_len = len - sizeof(unsigned int);
ItemPointerSetInvalid(&(tuple->t_self)); ItemPointerSetInvalid(&(tuple->t_self));
tuple->t_datamcxt = CurrentMemoryContext;
tuple->t_data = (HeapTupleHeader) (((char *) tuple) + HEAPTUPLESIZE); tuple->t_data = (HeapTupleHeader) (((char *) tuple) + HEAPTUPLESIZE);
/* read in the tuple proper */ /* read in the tuple proper */
if (LogicalTapeRead(state->tapeset, tapenum, (void *) tuple->t_data, if (LogicalTapeRead(state->tapeset, tapenum, (void *) tuple->t_data,
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/sort/tuplestore.c,v 1.23 2005/10/15 02:49:37 momjian Exp $ * $PostgreSQL: pgsql/src/backend/utils/sort/tuplestore.c,v 1.24 2005/11/20 19:49:08 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -707,7 +707,6 @@ readtup_heap(Tuplestorestate *state, unsigned int len) ...@@ -707,7 +707,6 @@ readtup_heap(Tuplestorestate *state, unsigned int len)
/* reconstruct the HeapTupleData portion */ /* reconstruct the HeapTupleData portion */
tuple->t_len = len - sizeof(unsigned int); tuple->t_len = len - sizeof(unsigned int);
ItemPointerSetInvalid(&(tuple->t_self)); ItemPointerSetInvalid(&(tuple->t_self));
tuple->t_datamcxt = CurrentMemoryContext;
tuple->t_data = (HeapTupleHeader) (((char *) tuple) + HEAPTUPLESIZE); tuple->t_data = (HeapTupleHeader) (((char *) tuple) + HEAPTUPLESIZE);
/* read in the tuple proper */ /* read in the tuple proper */
if (BufFileRead(state->myfile, (void *) tuple->t_data, if (BufFileRead(state->myfile, (void *) tuple->t_data,
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/access/htup.h,v 1.78 2005/10/15 02:49:42 momjian Exp $ * $PostgreSQL: pgsql/src/include/access/htup.h,v 1.79 2005/11/20 19:49:08 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -361,20 +361,20 @@ do { \ ...@@ -361,20 +361,20 @@ do { \
* *
* * Pointer to a tuple in a disk buffer: t_data points directly into the * * Pointer to a tuple in a disk buffer: t_data points directly into the
* buffer (which the code had better be holding a pin on, but this is not * buffer (which the code had better be holding a pin on, but this is not
* reflected in HeapTupleData itself). t_datamcxt must be NULL. * reflected in HeapTupleData itself).
* *
* * Pointer to nothing: t_data and t_datamcxt are NULL. This is used as * * Pointer to nothing: t_data is NULL. This is used as a failure indication
* a failure indication in some functions. * in some functions.
* *
* * Part of a palloc'd tuple: the HeapTupleData itself and the tuple * * Part of a palloc'd tuple: the HeapTupleData itself and the tuple
* form a single palloc'd chunk. t_data points to the memory location * form a single palloc'd chunk. t_data points to the memory location
* immediately following the HeapTupleData struct (at offset HEAPTUPLESIZE), * immediately following the HeapTupleData struct (at offset HEAPTUPLESIZE).
* and t_datamcxt is the containing context. This is used as the output * This is the output format of heap_form_tuple and related routines.
* format of heap_form_tuple and related routines.
* *
* * Separately allocated tuple: t_data points to a palloc'd chunk that * * Separately allocated tuple: t_data points to a palloc'd chunk that
* is not adjacent to the HeapTupleData, and t_datamcxt is the context * is not adjacent to the HeapTupleData. (This case is deprecated since
* containing that chunk. * it's difficult to tell apart from case #1. It should be used only in
* limited contexts where the code knows that case #1 will never apply.)
* *
* t_len should always be valid, except in the pointer-to-nothing case. * t_len should always be valid, except in the pointer-to-nothing case.
* t_self and t_tableOid should be valid if the HeapTupleData points to * t_self and t_tableOid should be valid if the HeapTupleData points to
...@@ -386,7 +386,6 @@ typedef struct HeapTupleData ...@@ -386,7 +386,6 @@ typedef struct HeapTupleData
uint32 t_len; /* length of *t_data */ uint32 t_len; /* length of *t_data */
ItemPointerData t_self; /* SelfItemPointer */ ItemPointerData t_self; /* SelfItemPointer */
Oid t_tableOid; /* table the tuple came from */ Oid t_tableOid; /* table the tuple came from */
MemoryContext t_datamcxt; /* memory context of allocation */
HeapTupleHeader t_data; /* -> tuple header and data */ HeapTupleHeader t_data; /* -> tuple header and data */
} HeapTupleData; } HeapTupleData;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment