Skip to content

Commit a2f01b9

Browse files
author
Alexander Korotkov
committed
Some fixes.
1 parent e083296 commit a2f01b9

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

src/backend/access/common/heaptuple.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,6 @@ heap_getsysattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
567567
case ObjectIdAttributeNumber:
568568
result = ObjectIdGetDatum(HeapTupleGetOid(tup));
569569
break;
570-
/* FIXME */
571570
case MinTransactionIdAttributeNumber:
572571
result = TransactionIdGetDatum(HeapTupleGetRawXmin(tup));
573572
break;

src/backend/access/heap/heapam.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2292,8 +2292,7 @@ heap_get_latest_tid(Relation relation,
22922292
static void
22932293
UpdateXmaxHintBits(HeapTupleHeader tuple, Buffer buffer, TransactionId xid)
22942294
{
2295-
/* FIXME */
2296-
/*Assert(TransactionIdEquals(HeapTupleHeaderGetRawXmax(tuple), xid));*/
2295+
Assert(TransactionIdEquals(HeapTupleHeaderGetRawXmax(BufferGetPage(buffer), tuple), xid));
22972296
Assert(!(tuple->t_infomask & HEAP_XMAX_IS_MULTI));
22982297

22992298
if (!(tuple->t_infomask & (HEAP_XMAX_COMMITTED | HEAP_XMAX_INVALID)))

src/backend/utils/fmgr/fmgr.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,7 @@ lookup_C_func(HeapTuple procedureTuple)
515515
NULL);
516516
if (entry == NULL)
517517
return NULL; /* no such entry */
518-
/* FIXME */
519-
if (/*entry->fn_xmin == HeapTupleHeaderGetRawXmin(procedureTuple->t_data) &&*/
518+
if (entry->fn_xmin == HeapTupleGetRawXmin(procedureTuple) &&
520519
ItemPointerEquals(&entry->fn_tid, &procedureTuple->t_self))
521520
return entry; /* OK */
522521
return NULL; /* entry is out of date */
@@ -553,8 +552,7 @@ record_C_func(HeapTuple procedureTuple,
553552
HASH_ENTER,
554553
&found);
555554
/* OID is already filled in */
556-
/* FIXME */
557-
/*entry->fn_xmin = HeapTupleHeaderGetRawXmin(procedureTuple->t_data);*/
555+
entry->fn_xmin = HeapTupleGetRawXmin(procedureTuple);
558556
entry->fn_tid = procedureTuple->t_self;
559557
entry->user_fn = user_fn;
560558
entry->inforec = inforec;

src/include/access/htup_details.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,13 @@ struct HeapTupleHeaderData
396396
(tup)->t_data->t_choice.t_heap.t_xmax) \
397397
)
398398

399+
#define HeapTupleHeaderGetRawXmax(page, tup) \
400+
( \
401+
ShortTransactionIdToNormal( \
402+
((tup)->t_infomask & HEAP_XMAX_IS_MULTI) ? ((PageHeader)(page))->pd_multi_epoch : ((PageHeader)(page))->pd_xid_epoch, \
403+
(tup)->t_choice.t_heap.t_xmax) \
404+
)
405+
399406
#define HeapTupleSetXmax(tup, xid) \
400407
( \
401408
(tup)->t_data->t_choice.t_heap.t_xmax = \

0 commit comments

Comments
 (0)