Skip to content

Commit 852a26f

Browse files
author
Hiroshi Inoue
committed
Fix my old fault(returns auto variable reference).
1 parent 21af10a commit 852a26f

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

src/backend/access/heap/heapam.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.121 2001/06/29 21:08:23 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.122 2001/07/06 09:41:36 inoue Exp $
1212
*
1313
*
1414
* INTERFACE ROUTINES
@@ -1024,7 +1024,8 @@ heap_get_latest_tid(Relation relation,
10241024
{
10251025
if (linkend)
10261026
return NULL;
1027-
return heap_get_latest_tid(relation, snapshot, &ctid);
1027+
heap_get_latest_tid(relation, snapshot, &ctid);
1028+
*tid = ctid;
10281029
}
10291030

10301031
return tid;

src/backend/utils/adt/tid.c

Lines changed: 7 additions & 13 deletions
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.24 2001/03/22 03:59:54 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/tid.c,v 1.25 2001/07/06 09:41:36 inoue Exp $
1212
*
1313
* NOTES
1414
* input routine largely stolen from boxin().
@@ -129,17 +129,14 @@ currtid_byreloid(PG_FUNCTION_ARGS)
129129
{
130130
Oid reloid = PG_GETARG_OID(0);
131131
ItemPointer tid = PG_GETARG_ITEMPOINTER(1);
132-
ItemPointer result,
133-
ret;
132+
ItemPointer result;
134133
Relation rel;
135134

136135
result = (ItemPointer) palloc(sizeof(ItemPointerData));
137-
ItemPointerSetInvalid(result);
136+
ItemPointerCopy(tid, result);
138137
if ((rel = heap_open(reloid, AccessShareLock)) != NULL)
139138
{
140-
ret = heap_get_latest_tid(rel, SnapshotNow, tid);
141-
if (ret)
142-
ItemPointerCopy(ret, result);
139+
heap_get_latest_tid(rel, SnapshotNow, result);
143140
heap_close(rel, AccessShareLock);
144141
}
145142
else
@@ -153,21 +150,18 @@ currtid_byrelname(PG_FUNCTION_ARGS)
153150
{
154151
text *relname = PG_GETARG_TEXT_P(0);
155152
ItemPointer tid = PG_GETARG_ITEMPOINTER(1);
156-
ItemPointer result,
157-
ret;
153+
ItemPointer result;
158154
char *str;
159155
Relation rel;
160156

161157
str = DatumGetCString(DirectFunctionCall1(textout,
162158
PointerGetDatum(relname)));
163159

164160
result = (ItemPointer) palloc(sizeof(ItemPointerData));
165-
ItemPointerSetInvalid(result);
161+
ItemPointerCopy(tid, result);
166162
if ((rel = heap_openr(str, AccessShareLock)) != NULL)
167163
{
168-
ret = heap_get_latest_tid(rel, SnapshotNow, tid);
169-
if (ret)
170-
ItemPointerCopy(ret, result);
164+
heap_get_latest_tid(rel, SnapshotNow, result);
171165
heap_close(rel, AccessShareLock);
172166
}
173167
else

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