|
7 | 7 | *
|
8 | 8 | *
|
9 | 9 | * IDENTIFICATION
|
10 |
| - * $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.11 1997/03/28 07:04:11 scrappy Exp $ |
| 10 | + * $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.12 1997/08/06 02:08:39 vadim Exp $ |
11 | 11 | *
|
12 | 12 | *
|
13 | 13 | * INTERFACE ROUTINES
|
@@ -1150,6 +1150,19 @@ heap_delete(Relation relation, ItemPointer tid)
|
1150 | 1150 | dp= (PageHeader)BufferGetPage(b);
|
1151 | 1151 | lp=PageGetItemId(dp,ItemPointerGetOffsetNumber(tid));
|
1152 | 1152 |
|
| 1153 | +/* |
| 1154 | + * Just like test against non-functional updates we try to catch |
| 1155 | + * non-functional delete attempts.- vadim 05/05/97 |
| 1156 | + */ |
| 1157 | +tp= (HeapTuple)PageGetItem((Page)dp,lp); |
| 1158 | +Assert(HeapTupleIsValid(tp)); |
| 1159 | +if (TupleUpdatedByCurXactAndCmd(tp)) { |
| 1160 | +elog(NOTICE,"Non-functional delete, tuple already deleted"); |
| 1161 | +if (IsSystemRelationName(RelationGetRelationName(relation)->data) ) |
| 1162 | +RelationUnsetLockForWrite(relation); |
| 1163 | +ReleaseBuffer(b); |
| 1164 | +return; |
| 1165 | + } |
1153 | 1166 | /* ----------------
|
1154 | 1167 | *check that we're deleteing a valid item
|
1155 | 1168 | * ----------------
|
|