mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Fix my old fault(returns auto variable reference).
This commit is contained in:
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.121 2001/06/29 21:08:23 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.122 2001/07/06 09:41:36 inoue Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* INTERFACE ROUTINES
|
* INTERFACE ROUTINES
|
||||||
@ -1024,7 +1024,8 @@ heap_get_latest_tid(Relation relation,
|
|||||||
{
|
{
|
||||||
if (linkend)
|
if (linkend)
|
||||||
return NULL;
|
return NULL;
|
||||||
return heap_get_latest_tid(relation, snapshot, &ctid);
|
heap_get_latest_tid(relation, snapshot, &ctid);
|
||||||
|
*tid = ctid;
|
||||||
}
|
}
|
||||||
|
|
||||||
return tid;
|
return tid;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/tid.c,v 1.24 2001/03/22 03:59:54 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/adt/tid.c,v 1.25 2001/07/06 09:41:36 inoue Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* input routine largely stolen from boxin().
|
* input routine largely stolen from boxin().
|
||||||
@ -129,17 +129,14 @@ currtid_byreloid(PG_FUNCTION_ARGS)
|
|||||||
{
|
{
|
||||||
Oid reloid = PG_GETARG_OID(0);
|
Oid reloid = PG_GETARG_OID(0);
|
||||||
ItemPointer tid = PG_GETARG_ITEMPOINTER(1);
|
ItemPointer tid = PG_GETARG_ITEMPOINTER(1);
|
||||||
ItemPointer result,
|
ItemPointer result;
|
||||||
ret;
|
|
||||||
Relation rel;
|
Relation rel;
|
||||||
|
|
||||||
result = (ItemPointer) palloc(sizeof(ItemPointerData));
|
result = (ItemPointer) palloc(sizeof(ItemPointerData));
|
||||||
ItemPointerSetInvalid(result);
|
ItemPointerCopy(tid, result);
|
||||||
if ((rel = heap_open(reloid, AccessShareLock)) != NULL)
|
if ((rel = heap_open(reloid, AccessShareLock)) != NULL)
|
||||||
{
|
{
|
||||||
ret = heap_get_latest_tid(rel, SnapshotNow, tid);
|
heap_get_latest_tid(rel, SnapshotNow, result);
|
||||||
if (ret)
|
|
||||||
ItemPointerCopy(ret, result);
|
|
||||||
heap_close(rel, AccessShareLock);
|
heap_close(rel, AccessShareLock);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -153,8 +150,7 @@ currtid_byrelname(PG_FUNCTION_ARGS)
|
|||||||
{
|
{
|
||||||
text *relname = PG_GETARG_TEXT_P(0);
|
text *relname = PG_GETARG_TEXT_P(0);
|
||||||
ItemPointer tid = PG_GETARG_ITEMPOINTER(1);
|
ItemPointer tid = PG_GETARG_ITEMPOINTER(1);
|
||||||
ItemPointer result,
|
ItemPointer result;
|
||||||
ret;
|
|
||||||
char *str;
|
char *str;
|
||||||
Relation rel;
|
Relation rel;
|
||||||
|
|
||||||
@ -162,12 +158,10 @@ currtid_byrelname(PG_FUNCTION_ARGS)
|
|||||||
PointerGetDatum(relname)));
|
PointerGetDatum(relname)));
|
||||||
|
|
||||||
result = (ItemPointer) palloc(sizeof(ItemPointerData));
|
result = (ItemPointer) palloc(sizeof(ItemPointerData));
|
||||||
ItemPointerSetInvalid(result);
|
ItemPointerCopy(tid, result);
|
||||||
if ((rel = heap_openr(str, AccessShareLock)) != NULL)
|
if ((rel = heap_openr(str, AccessShareLock)) != NULL)
|
||||||
{
|
{
|
||||||
ret = heap_get_latest_tid(rel, SnapshotNow, tid);
|
heap_get_latest_tid(rel, SnapshotNow, result);
|
||||||
if (ret)
|
|
||||||
ItemPointerCopy(ret, result);
|
|
||||||
heap_close(rel, AccessShareLock);
|
heap_close(rel, AccessShareLock);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user