Skip to content

Commit fc5ec42

Browse files
author
Hiroshi Inoue
committed
Apply 7.1.3 changes to the current tree also.
1 parent c0d4d54 commit fc5ec42

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

src/backend/executor/execMain.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*
2828
*
2929
* IDENTIFICATION
30-
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.145 2001/08/10 18:57:35 tgl Exp $
30+
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.146 2001/09/08 16:15:28 inoue Exp $
3131
*
3232
*-------------------------------------------------------------------------
3333
*/
@@ -1268,6 +1268,7 @@ ExecAppend(TupleTableSlot *slot,
12681268
* insert the tuple
12691269
*/
12701270
newId = heap_insert(resultRelationDesc, tuple);
1271+
setLastTid(&(tuple->t_self));
12711272

12721273
IncrAppended();
12731274
(estate->es_processed)++;

src/backend/utils/adt/tid.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/tid.c,v 1.25 2001/07/06 09:41:36 inoue Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/tid.c,v 1.26 2001/09/08 16:15:28 inoue Exp $
1212
*
1313
* NOTES
1414
* input routine largely stolen from boxin().
@@ -124,6 +124,11 @@ tidne(PG_FUNCTION_ARGS)
124124
*
125125
* Maybe these implementations should be moved to another place
126126
*/
127+
static ItemPointerData Current_last_tid = { {0, 0}, 0};
128+
void setLastTid(const ItemPointer tid)
129+
{
130+
Current_last_tid = *tid;
131+
}
127132
Datum
128133
currtid_byreloid(PG_FUNCTION_ARGS)
129134
{
@@ -133,6 +138,11 @@ currtid_byreloid(PG_FUNCTION_ARGS)
133138
Relation rel;
134139

135140
result = (ItemPointer) palloc(sizeof(ItemPointerData));
141+
if (!reloid)
142+
{
143+
*result = Current_last_tid;
144+
PG_RETURN_ITEMPOINTER(result);
145+
}
136146
ItemPointerCopy(tid, result);
137147
if ((rel = heap_open(reloid, AccessShareLock)) != NULL)
138148
{

src/include/access/heapam.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $Id: heapam.h,v 1.66 2001/07/12 04:11:13 tgl Exp $
10+
* $Id: heapam.h,v 1.67 2001/09/08 16:15:28 inoue Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -205,6 +205,7 @@ extern void heap_endscan(HeapScanDesc scan);
205205
extern HeapTuple heap_getnext(HeapScanDesc scandesc, int backw);
206206
extern void heap_fetch(Relation relation, Snapshot snapshot, HeapTuple tup, Buffer *userbuf, IndexScanDesc iscan);
207207
extern ItemPointer heap_get_latest_tid(Relation relation, Snapshot snapshot, ItemPointer tid);
208+
extern void setLastid(const ItemPointer tid);
208209
extern Oid heap_insert(Relation relation, HeapTuple tup);
209210
extern int heap_delete(Relation relation, ItemPointer tid, ItemPointer ctid);
210211
extern int heap_update(Relation relation, ItemPointer otid, HeapTuple tup,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy