> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cockroachlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Technical Advisory 93314

export const InternalLink = ({version, path = "", children, ...props}) => {
  let detectedVersion = version || "stable";
  if (typeof window !== 'undefined' && !version) {
    const match = window.location.pathname.match(/\/docs\/([^/]+)/);
    if (match) {
      detectedVersion = match[1];
    }
  }
  const normalizedPath = path.startsWith("/") ? path.slice(1) : path;
  return <a href={`/docs/${detectedVersion}/${normalizedPath}`} {...props}>
      {children}
    </a>;
};

Publication date: January 4, 2023

## Description

In CockroachDB <InternalLink version="releases" path="v22.2">v22.2.0</InternalLink> and <InternalLink version="releases" path="v22.2">v22.2.1</InternalLink>, if a [user-defined function (UDF)](https://www.cockroachlabs.com/docs/v22.2/user-defined-functions) is created using any implicit record type which contains a column of user-defined [`ENUM`](https://www.cockroachlabs.com/docs/v22.2/enum) type as the function’s parameter type or return type, the CockroachDB instance will crash and refuse to start. For example:

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
CREATE TYPE e AS ENUM ('a', 'b');
CREATE TABLE t (a INT, b e);
CREATE OR REPLACE FUNCTION f () RETURNS t AS
$$
  SELECT a, b
  FROM t
  ORDER BY a
  LIMIT 1;
$$ LANGUAGE SQL; -- CockroachDB cluster crashes when this query is run
```

## Statement

This is resolved in CockroachDB by a fix that addresses infinite recursion during the type hydration for catalog descriptors.

The fix has been applied to maintenance releases of CockroachDB <InternalLink version="releases" path="v22.2">v22.2.2</InternalLink> and later.

## Mitigation

Users of CockroachDB <InternalLink version="releases" path="v22.2">v22.2.0</InternalLink> and <InternalLink version="releases" path="v22.2">v22.2.1</InternalLink> should avoid creating a [user-defined function (UDF)](https://www.cockroachlabs.com/docs/v22.2/user-defined-functions) using any implicit record type that contains a field of user-defined [`ENUM`](https://www.cockroachlabs.com/docs/v22.2/enum) type as the function’s parameter type or return type.

Users of CockroachDB v22.2.0 and v22.2.1 are encouraged to upgrade to version v22.2.2 or later.

## Impact

CockroachDB instances crash and refuse to start unless upgraded to v22.2.2 or a later version.

Please reach out to the [support team](https://support.cockroachlabs.com/) if more information or assistance is needed.
