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

Function FuncNameAsType

src/backend/parser/parse_func.c:1935–1958  ·  view source on GitHub ↗

* FuncNameAsType - * convenience routine to see if a function name matches a type name * * Returns the OID of the matching type, or InvalidOid if none. We ignore * shell types and complex types. */

Source from the content-addressed store, hash-verified

1933 * shell types and complex types.
1934 */
1935static Oid
1936FuncNameAsType(List *funcname)
1937{
1938 Oid result;
1939 Type typtup;
1940
1941 /*
1942 * temp_ok=false protects the <refsect1 id="sql-createfunction-security">
1943 * contract for writing SECURITY DEFINER functions safely.
1944 */
1945 typtup = LookupTypeNameExtended(NULL, makeTypeNameFromNameList(funcname),
1946 NULL, false, false);
1947 if (typtup == NULL)
1948 return InvalidOid;
1949
1950 if (((Form_pg_type) GETSTRUCT(typtup))->typisdefined &&
1951 !OidIsValid(typeTypeRelid(typtup)))
1952 result = typeTypeId(typtup);
1953 else
1954 result = InvalidOid;
1955
1956 ReleaseSysCache(typtup);
1957 return result;
1958}
1959
1960/*
1961 * ParseComplexProjection -

Callers 1

func_get_detailFunction · 0.85

Calls 5

LookupTypeNameExtendedFunction · 0.85
makeTypeNameFromNameListFunction · 0.85
typeTypeRelidFunction · 0.85
typeTypeIdFunction · 0.85
ReleaseSysCacheFunction · 0.85

Tested by

no test coverage detected