Commit c3b09c22 authored by Vadim B. Mikheev's avatar Vadim B. Mikheev

Fix HEAP_MOVED_IN handling in HeapTupleSatisfiesDirty().

parent 12a5aa4f
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.27 1999/04/05 10:55:49 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/time/tqual.c,v 1.28 1999/04/12 16:57:27 vadim Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -422,17 +422,21 @@ HeapTupleSatisfiesDirty(HeapTupleHeader tuple) ...@@ -422,17 +422,21 @@ HeapTupleSatisfiesDirty(HeapTupleHeader tuple)
tuple->t_infomask |= HEAP_XMIN_INVALID; tuple->t_infomask |= HEAP_XMIN_INVALID;
return false; return false;
} }
tuple->t_infomask |= HEAP_XMIN_COMMITTED;
} }
else if (tuple->t_infomask & HEAP_MOVED_IN) else if (tuple->t_infomask & HEAP_MOVED_IN)
{ {
if (TransactionIdIsCurrentTransactionId((TransactionId)tuple->t_cmin)) if (!TransactionIdIsCurrentTransactionId((TransactionId)tuple->t_cmin))
return true; {
if (!TransactionIdDidCommit((TransactionId)tuple->t_cmin)) if (TransactionIdDidCommit((TransactionId)tuple->t_cmin))
tuple->t_infomask |= HEAP_XMIN_COMMITTED;
else
{ {
tuple->t_infomask |= HEAP_XMIN_INVALID; tuple->t_infomask |= HEAP_XMIN_INVALID;
return false; return false;
} }
} }
}
else if (TransactionIdIsCurrentTransactionId(tuple->t_xmin)) else if (TransactionIdIsCurrentTransactionId(tuple->t_xmin))
{ {
if (tuple->t_infomask & HEAP_XMAX_INVALID) /* xid invalid */ if (tuple->t_infomask & HEAP_XMAX_INVALID) /* xid invalid */
...@@ -455,6 +459,7 @@ HeapTupleSatisfiesDirty(HeapTupleHeader tuple) ...@@ -455,6 +459,7 @@ HeapTupleSatisfiesDirty(HeapTupleHeader tuple)
SnapshotDirty->xmin = tuple->t_xmin; SnapshotDirty->xmin = tuple->t_xmin;
return true; /* in insertion by other */ return true; /* in insertion by other */
} }
else
tuple->t_infomask |= HEAP_XMIN_COMMITTED; tuple->t_infomask |= HEAP_XMIN_COMMITTED;
} }
......
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