Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit40ac5a6

Browse files
committed
heap_delete returns int now (for non-functional deletes).
1 parentceac1d5 commit40ac5a6

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

‎src/backend/access/heap/heapam.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.14 1997/08/19 21:29:17 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.15 1997/08/27 09:00:20 vadim Exp $
1111
*
1212
*
1313
* INTERFACE ROUTINES
@@ -1114,7 +1114,7 @@ heap_insert(Relation relation, HeapTuple tup)
11141114
*Must decide how to handle errors.
11151115
* ----------------
11161116
*/
1117-
void
1117+
int
11181118
heap_delete(Relationrelation,ItemPointertid)
11191119
{
11201120
ItemIdlp;
@@ -1163,7 +1163,7 @@ heap_delete(Relation relation, ItemPointer tid)
11631163
if (IsSystemRelationName(RelationGetRelationName(relation)->data) )
11641164
RelationUnsetLockForWrite(relation);
11651165
ReleaseBuffer(b);
1166-
return;
1166+
return (1);
11671167
}
11681168
/* ----------------
11691169
*check that we're deleteing a valid item
@@ -1203,6 +1203,8 @@ heap_delete(Relation relation, ItemPointer tid)
12031203
WriteBuffer(b);
12041204
if (IsSystemRelationName(RelationGetRelationName(relation)->data) )
12051205
RelationUnsetLockForWrite(relation);
1206+
1207+
return(0);
12061208
}
12071209

12081210
/* ----------------
@@ -1302,10 +1304,10 @@ heap_replace(Relation relation, ItemPointer otid, HeapTuple tup)
13021304
NowTimeQual,
13031305
0,
13041306
(ScanKey)NULL))
1305-
{
1306-
ReleaseBuffer(buffer);
1307-
elog(WARN,"heap_replace: (am)invalid otid");
1308-
}
1307+
{
1308+
ReleaseBuffer(buffer);
1309+
elog(WARN,"heap_replace: (am)invalid otid");
1310+
}
13091311

13101312
/* XXX order problems if not atomic assignment ??? */
13111313
tup->t_oid=tp->t_oid;

‎src/include/access/heapam.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: heapam.h,v 1.8 1997/08/26 23:31:53 momjian Exp $
9+
* $Id: heapam.h,v 1.9 1997/08/27 09:03:47 vadim Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -124,7 +124,7 @@ extern HeapTuple heap_getnext(HeapScanDesc scandesc, int backw, Buffer *b);
124124
externHeapTupleheap_fetch(Relationrelation,TimeQualtimeQual,
125125
ItemPointertid,Buffer*b);
126126
externOidheap_insert(Relationrelation,HeapTupletup);
127-
externvoidheap_delete(Relationrelation,ItemPointertid);
127+
externintheap_delete(Relationrelation,ItemPointertid);
128128
externintheap_replace(Relationrelation,ItemPointerotid,
129129
HeapTupletup);
130130
externvoidheap_markpos(HeapScanDescsdesc);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp