Skip to content

Commit 51a1820

Browse files
committed
Backpatch SearchSysCacheTupleCopy fix for init_fcache.
1 parent 91ccad9 commit 51a1820

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/backend/utils/cache/fcache.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.30 2000/04/12 17:15:53 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/cache/Attic/fcache.c,v 1.30.2.1 2000/06/06 17:45:05 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
1515
#include "postgres.h"
1616

17+
#include "access/heapam.h"
1718
#include "catalog/pg_language.h"
1819
#include "catalog/pg_proc.h"
1920
#include "catalog/pg_type.h"
@@ -89,9 +90,9 @@ init_fcache(Oid foid,
8990
if (!use_syscache)
9091
elog(ERROR, "what the ????, init the fcache without the catalogs?");
9192

92-
procedureTuple = SearchSysCacheTuple(PROCOID,
93-
ObjectIdGetDatum(foid),
94-
0, 0, 0);
93+
procedureTuple = SearchSysCacheTupleCopy(PROCOID,
94+
ObjectIdGetDatum(foid),
95+
0, 0, 0);
9596

9697
if (!HeapTupleIsValid(procedureTuple))
9798
elog(ERROR, "init_fcache: Cache lookup failed for procedure %u",
@@ -259,6 +260,8 @@ init_fcache(Oid foid,
259260
else
260261
retval->func.fn_addr = (func_ptr) NULL;
261262

263+
heap_freetuple(procedureTuple);
264+
262265
return retval;
263266
}
264267

0 commit comments

Comments
 (0)