|
31 | 31 | * Portions Copyright (c) 1994, Regents of the University of California |
32 | 32 | * |
33 | 33 | * IDENTIFICATION |
34 | | - * $PostgreSQL: pgsql/src/backend/utils/time/tqual.c,v 1.105 2007/09/08 20:31:15 tgl Exp $ |
| 34 | + * $PostgreSQL: pgsql/src/backend/utils/time/tqual.c,v 1.106 2007/09/21 18:24:28 tgl Exp $ |
35 | 35 | * |
36 | 36 | *------------------------------------------------------------------------- |
37 | 37 | */ |
@@ -219,16 +219,14 @@ HeapTupleSatisfiesSelf(HeapTupleHeader tuple, Snapshot snapshot, Buffer buffer) |
219 | 219 |
|
220 | 220 | Assert(!(tuple->t_infomask&HEAP_XMAX_IS_MULTI)); |
221 | 221 |
|
222 | | -/* deleting subtransaction aborted? */ |
223 | | -if (TransactionIdDidAbort(HeapTupleHeaderGetXmax(tuple))) |
| 222 | +if (!TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmax(tuple))) |
224 | 223 | { |
| 224 | +/* deleting subtransaction must have aborted */ |
225 | 225 | SetHintBits(tuple,buffer,HEAP_XMAX_INVALID, |
226 | 226 | InvalidTransactionId); |
227 | 227 | return true; |
228 | 228 | } |
229 | 229 |
|
230 | | -Assert(TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmax(tuple))); |
231 | | - |
232 | 230 | return false; |
233 | 231 | } |
234 | 232 | elseif (TransactionIdIsInProgress(HeapTupleHeaderGetXmin(tuple))) |
@@ -395,16 +393,14 @@ HeapTupleSatisfiesNow(HeapTupleHeader tuple, Snapshot snapshot, Buffer buffer) |
395 | 393 |
|
396 | 394 | Assert(!(tuple->t_infomask&HEAP_XMAX_IS_MULTI)); |
397 | 395 |
|
398 | | -/* deleting subtransaction aborted? */ |
399 | | -if (TransactionIdDidAbort(HeapTupleHeaderGetXmax(tuple))) |
| 396 | +if (!TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmax(tuple))) |
400 | 397 | { |
| 398 | +/* deleting subtransaction must have aborted */ |
401 | 399 | SetHintBits(tuple,buffer,HEAP_XMAX_INVALID, |
402 | 400 | InvalidTransactionId); |
403 | 401 | return true; |
404 | 402 | } |
405 | 403 |
|
406 | | -Assert(TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmax(tuple))); |
407 | | - |
408 | 404 | if (HeapTupleHeaderGetCmax(tuple) >=GetCurrentCommandId()) |
409 | 405 | return true;/* deleted after scan started */ |
410 | 406 | else |
@@ -640,16 +636,14 @@ HeapTupleSatisfiesUpdate(HeapTupleHeader tuple, CommandId curcid, |
640 | 636 |
|
641 | 637 | Assert(!(tuple->t_infomask&HEAP_XMAX_IS_MULTI)); |
642 | 638 |
|
643 | | -/* deleting subtransaction aborted? */ |
644 | | -if (TransactionIdDidAbort(HeapTupleHeaderGetXmax(tuple))) |
| 639 | +if (!TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmax(tuple))) |
645 | 640 | { |
| 641 | +/* deleting subtransaction must have aborted */ |
646 | 642 | SetHintBits(tuple,buffer,HEAP_XMAX_INVALID, |
647 | 643 | InvalidTransactionId); |
648 | 644 | returnHeapTupleMayBeUpdated; |
649 | 645 | } |
650 | 646 |
|
651 | | -Assert(TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmax(tuple))); |
652 | | - |
653 | 647 | if (HeapTupleHeaderGetCmax(tuple) >=curcid) |
654 | 648 | returnHeapTupleSelfUpdated;/* updated after scan started */ |
655 | 649 | else |
@@ -806,16 +800,14 @@ HeapTupleSatisfiesDirty(HeapTupleHeader tuple, Snapshot snapshot, |
806 | 800 |
|
807 | 801 | Assert(!(tuple->t_infomask&HEAP_XMAX_IS_MULTI)); |
808 | 802 |
|
809 | | -/* deleting subtransaction aborted? */ |
810 | | -if (TransactionIdDidAbort(HeapTupleHeaderGetXmax(tuple))) |
| 803 | +if (!TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmax(tuple))) |
811 | 804 | { |
| 805 | +/* deleting subtransaction must have aborted */ |
812 | 806 | SetHintBits(tuple,buffer,HEAP_XMAX_INVALID, |
813 | 807 | InvalidTransactionId); |
814 | 808 | return true; |
815 | 809 | } |
816 | 810 |
|
817 | | -Assert(TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmax(tuple))); |
818 | | - |
819 | 811 | return false; |
820 | 812 | } |
821 | 813 | elseif (TransactionIdIsInProgress(HeapTupleHeaderGetXmin(tuple))) |
@@ -970,17 +962,14 @@ HeapTupleSatisfiesMVCC(HeapTupleHeader tuple, Snapshot snapshot, |
970 | 962 |
|
971 | 963 | Assert(!(tuple->t_infomask&HEAP_XMAX_IS_MULTI)); |
972 | 964 |
|
973 | | -/* deleting subtransaction aborted? */ |
974 | | -/* FIXME -- is this correct w.r.t. the cmax of the tuple? */ |
975 | | -if (TransactionIdDidAbort(HeapTupleHeaderGetXmax(tuple))) |
| 965 | +if (!TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmax(tuple))) |
976 | 966 | { |
| 967 | +/* deleting subtransaction must have aborted */ |
977 | 968 | SetHintBits(tuple,buffer,HEAP_XMAX_INVALID, |
978 | 969 | InvalidTransactionId); |
979 | 970 | return true; |
980 | 971 | } |
981 | 972 |
|
982 | | -Assert(TransactionIdIsCurrentTransactionId(HeapTupleHeaderGetXmax(tuple))); |
983 | | - |
984 | 973 | if (HeapTupleHeaderGetCmax(tuple) >=snapshot->curcid) |
985 | 974 | return true;/* deleted after scan started */ |
986 | 975 | else |
|