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

Function SearchSysCacheAttNum

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

* SearchSysCacheAttNum * * This routine is equivalent to SearchSysCache on the ATTNUM cache, * except that it will return NULL if the found attribute is marked * attisdropped. This is convenient for callers that want to act as * though dropped attributes don't exist. */

Source from the content-addressed store, hash-verified

1557 * though dropped attributes don't exist.
1558 */
1559HeapTuple
1560SearchSysCacheAttNum(Oid relid, int16 attnum)
1561{
1562 HeapTuple tuple;
1563
1564 tuple = SearchSysCache2(ATTNUM,
1565 ObjectIdGetDatum(relid),
1566 Int16GetDatum(attnum));
1567 if (!HeapTupleIsValid(tuple))
1568 return NULL;
1569 if (((Form_pg_attribute) GETSTRUCT(tuple))->attisdropped)
1570 {
1571 ReleaseSysCache(tuple);
1572 return NULL;
1573 }
1574 return tuple;
1575}
1576
1577/*
1578 * SearchSysCacheCopyAttNum

Callers 1

SearchSysCacheCopyAttNumFunction · 0.85

Calls 4

SearchSysCache2Function · 0.85
ObjectIdGetDatumFunction · 0.85
Int16GetDatumFunction · 0.85
ReleaseSysCacheFunction · 0.85

Tested by

no test coverage detected