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

Function GetSysCacheOid

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

* GetSysCacheOid * * A convenience routine that does SearchSysCache and returns the OID in the * oidcol column of the found tuple, or InvalidOid if no tuple could be found. * No lock is retained on the syscache entry. */

Source from the content-addressed store, hash-verified

1462 * No lock is retained on the syscache entry.
1463 */
1464Oid
1465GetSysCacheOid(int cacheId,
1466 AttrNumber oidcol,
1467 Datum key1,
1468 Datum key2,
1469 Datum key3,
1470 Datum key4)
1471{
1472 HeapTuple tuple;
1473 bool isNull;
1474 Oid result;
1475
1476 tuple = SearchSysCache(cacheId, key1, key2, key3, key4);
1477 if (!HeapTupleIsValid(tuple))
1478 return InvalidOid;
1479 result = heap_getattr(tuple, oidcol,
1480 SysCache[cacheId]->cc_tupdesc,
1481 &isNull);
1482 Assert(!isNull); /* columns used as oids should never be NULL */
1483 ReleaseSysCache(tuple);
1484 return result;
1485}
1486
1487
1488/*

Callers 1

dbms_assert_schema_nameFunction · 0.85

Calls 3

SearchSysCacheFunction · 0.85
heap_getattrFunction · 0.85
ReleaseSysCacheFunction · 0.85

Tested by

no test coverage detected