/*
- * $Header: /cvsroot/pgsql/contrib/pgstattuple/pgstattuple.c,v 1.12 2003/08/04 00:43:11 momjian Exp $
+ * $Header: /cvsroot/pgsql/contrib/pgstattuple/pgstattuple.c,v 1.12.4.1 2004/10/13 22:22:00 tgl Exp $
*
* Copyright (c) 2001,2002 Tatsuo Ishii
*
/* scan the relation */
while ((tuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
{
+ uint16 sv_infomask;
+
+ sv_infomask = tuple->t_data->t_infomask;
if (HeapTupleSatisfiesNow(tuple->t_data))
{
tuple_len += tuple->t_len;
dead_tuple_len += tuple->t_len;
dead_tuple_count++;
}
+ if (sv_infomask != tuple->t_data->t_infomask)
+ SetBufferCommitInfoNeedsSave(scan->rs_cbuf);
/*
* To avoid physically reading the table twice, try to do the
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.157 2003/10/01 21:30:52 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.157.2.1 2004/10/13 22:22:02 tgl Exp $
*
*
* INTERFACE ROUTINES
PageHeader dp;
Buffer buffer;
int result;
+ uint16 sv_infomask;
Assert(ItemPointerIsValid(tid));
tp.t_tableOid = relation->rd_id;
l1:
+ sv_infomask = tp.t_data->t_infomask;
result = HeapTupleSatisfiesUpdate(tp.t_data, cid);
+ if (sv_infomask != tp.t_data->t_infomask)
+ SetBufferCommitInfoNeedsSave(buffer);
if (result == HeapTupleInvisible)
{
XactLockTableWait(xwait);
LockBuffer(buffer, BUFFER_LOCK_EXCLUSIVE);
- if (TransactionIdDidAbort(xwait))
+ if (!TransactionIdDidCommit(xwait))
goto l1;
/*
if (crosscheck != SnapshotAny && result == HeapTupleMayBeUpdated)
{
/* Perform additional check for serializable RI updates */
+ sv_infomask = tp.t_data->t_infomask;
if (!HeapTupleSatisfiesSnapshot(tp.t_data, crosscheck))
result = HeapTupleUpdated;
+ if (sv_infomask != tp.t_data->t_infomask)
+ SetBufferCommitInfoNeedsSave(buffer);
}
if (result != HeapTupleMayBeUpdated)
Size newtupsize,
pagefree;
int result;
+ uint16 sv_infomask;
Assert(ItemPointerIsValid(otid));
*/
l2:
+ sv_infomask = oldtup.t_data->t_infomask;
result = HeapTupleSatisfiesUpdate(oldtup.t_data, cid);
+ if (sv_infomask != oldtup.t_data->t_infomask)
+ SetBufferCommitInfoNeedsSave(buffer);
if (result == HeapTupleInvisible)
{
XactLockTableWait(xwait);
LockBuffer(buffer, BUFFER_LOCK_EXCLUSIVE);
- if (TransactionIdDidAbort(xwait))
+ if (!TransactionIdDidCommit(xwait))
goto l2;
/*
if (crosscheck != SnapshotAny && result == HeapTupleMayBeUpdated)
{
/* Perform additional check for serializable RI updates */
+ sv_infomask = oldtup.t_data->t_infomask;
if (!HeapTupleSatisfiesSnapshot(oldtup.t_data, crosscheck))
result = HeapTupleUpdated;
+ if (sv_infomask != oldtup.t_data->t_infomask)
+ SetBufferCommitInfoNeedsSave(buffer);
}
if (result != HeapTupleMayBeUpdated)
ItemId lp;
PageHeader dp;
int result;
+ uint16 sv_infomask;
*buffer = ReadBuffer(relation, ItemPointerGetBlockNumber(tid));
tuple->t_len = ItemIdGetLength(lp);
l3:
+ sv_infomask = tuple->t_data->t_infomask;
result = HeapTupleSatisfiesUpdate(tuple->t_data, cid);
+ if (sv_infomask != tuple->t_data->t_infomask)
+ SetBufferCommitInfoNeedsSave(*buffer);
if (result == HeapTupleInvisible)
{
XactLockTableWait(xwait);
LockBuffer(*buffer, BUFFER_LOCK_EXCLUSIVE);
- if (TransactionIdDidAbort(xwait))
+ if (!TransactionIdDidCommit(xwait))
goto l3;
/*
*
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/ri_triggers.c,v 1.63 2003/10/31 03:58:20 wieck Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/ri_triggers.c,v 1.63.2.1 2004/10/13 22:22:03 tgl Exp $
*
* ----------
*/
* We should not even consider checking the row if it is no longer
* valid since it was either deleted (doesn't matter) or updated (in
* which case it'll be checked with its final values).
+ *
+ * Note: we need not SetBufferCommitInfoNeedsSave() here since the
+ * new tuple's commit state can't possibly change.
*/
if (new_row)
{