Re: Pg17 Crash in Planning (Arrays + Casting + UDF)

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Nathan Bossart <nathandbossart@gmail.com>
Cc: Paul Ramsey <pramsey@cleverelephant.ca>, Pgsql Hackers <pgsql-hackers@postgresql.org>, Regina Obe <lr@pcorp.us>, Fredrik Widlert <fredrik.widlert@digpro.se>
Date: 2024-10-09T20:51:47Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Avoid crash in estimate_array_length with null root pointer.

  2. Teach estimate_array_length() to use statistics where available.

Nathan Bossart <nathandbossart@gmail.com> writes:
> Do you mean something like this?

> -    else if (arrayexpr)
> +    else if (arrayexpr && root != NULL)

> That'd at least be no worse than how it worked before
> estimate_array_length() tried to use statistics, so that seems reasonable
> to me.

Yeah, exactly, just fall back to the old behavior if no root.

			regards, tom lane