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

Function get_typsubscript

src/backend/utils/cache/lsyscache.c:3697–3719  ·  view source on GitHub ↗

* get_typsubscript * * Given the type OID, return the type's subscripting handler's OID, * if it has one. * * If typelemp isn't NULL, we also store the type's typelem value there. * This saves some callers an extra catalog lookup. */

Source from the content-addressed store, hash-verified

3695 * This saves some callers an extra catalog lookup.
3696 */
3697RegProcedure
3698get_typsubscript(Oid typid, Oid *typelemp)
3699{
3700 HeapTuple tp;
3701
3702 tp = SearchSysCache1(TYPEOID, ObjectIdGetDatum(typid));
3703 if (HeapTupleIsValid(tp))
3704 {
3705 Form_pg_type typform = (Form_pg_type) GETSTRUCT(tp);
3706 RegProcedure handler = typform->typsubscript;
3707
3708 if (typelemp)
3709 *typelemp = typform->typelem;
3710 ReleaseSysCache(tp);
3711 return handler;
3712 }
3713 else
3714 {
3715 if (typelemp)
3716 *typelemp = InvalidOid;
3717 return InvalidOid;
3718 }
3719}
3720
3721/*
3722 * getSubscriptingRoutines

Callers 2

exec_check_rw_parameterFunction · 0.85
getSubscriptingRoutinesFunction · 0.85

Calls 3

SearchSysCache1Function · 0.85
ObjectIdGetDatumFunction · 0.85
ReleaseSysCacheFunction · 0.85

Tested by

no test coverage detected