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

Function find_enumitem

src/backend/utils/cache/typcache.c:2783–2795  ·  view source on GitHub ↗

* Locate the EnumItem with the given OID, if present */

Source from the content-addressed store, hash-verified

2781 * Locate the EnumItem with the given OID, if present
2782 */
2783static EnumItem *
2784find_enumitem(TypeCacheEnumData *enumdata, Oid arg)
2785{
2786 EnumItem srch;
2787
2788 /* On some versions of Solaris, bsearch of zero items dumps core */
2789 if (enumdata->num_values <= 0)
2790 return NULL;
2791
2792 srch.enum_oid = arg;
2793 return bsearch(&srch, enumdata->enum_values, enumdata->num_values,
2794 sizeof(EnumItem), enum_oid_cmp);
2795}
2796
2797/*
2798 * qsort comparison function for OID-ordered EnumItems

Callers 1

compare_values_of_enumFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected