MCPcopy Create free account
hub / github.com/apache/cloudberry / SearchSysCacheCopy

Function SearchSysCacheCopy

src/backend/utils/cache/syscache.c:1417–1433  ·  view source on GitHub ↗

* SearchSysCacheCopy * * A convenience routine that does SearchSysCache and (if successful) * returns a modifiable copy of the syscache entry. The original * syscache entry is released before returning. The caller should * heap_freetuple() the result when done with it. */

Source from the content-addressed store, hash-verified

1415 * heap_freetuple() the result when done with it.
1416 */
1417HeapTuple
1418SearchSysCacheCopy(int cacheId,
1419 Datum key1,
1420 Datum key2,
1421 Datum key3,
1422 Datum key4)
1423{
1424 HeapTuple tuple,
1425 newtuple;
1426
1427 tuple = SearchSysCache(cacheId, key1, key2, key3, key4);
1428 if (!HeapTupleIsValid(tuple))
1429 return tuple;
1430 newtuple = heap_copytuple(tuple);
1431 ReleaseSysCache(tuple);
1432 return newtuple;
1433}
1434
1435/*
1436 * SearchSysCacheExists

Callers 1

Calls 3

SearchSysCacheFunction · 0.85
heap_copytupleFunction · 0.85
ReleaseSysCacheFunction · 0.85

Tested by

no test coverage detected