Re: pgsql: Fix list_copy_head() with empty Lists - Mailing list pgsql-committers

From Tom Lane
Subject Re: pgsql: Fix list_copy_head() with empty Lists
Date
Msg-id 3129478.1681997309@sss.pgh.pa.us
Whole thread Raw
In response to pgsql: Fix list_copy_head() with empty Lists  (David Rowley <drowley@postgresql.org>)
Responses Re: pgsql: Fix list_copy_head() with empty Lists
List pgsql-committers
David Rowley <drowley@postgresql.org> writes:
> Fix list_copy_head() with empty Lists

> list_copy_head() given an empty List would crash from trying to
> dereference the List to obtain its length.  Since NIL is how we represent
> an empty List, we should just be returning another empty List in this
> case.

I see that list_copy_head exists in v15 as well.  It appears to have
no callers there, but we'd better fix it anyway in case somebody
back-patches a fix that uses it.

Or, maybe, remove it in 15?

            regards, tom lane



pgsql-committers by date:

Previous
From: David Rowley
Date:
Subject: pgsql: Doc: clarify NULLS NOT DISTINCT use in unique indexes
Next
From: Daniel Gustafsson
Date:
Subject: pgsql: Fix autovacuum cost debug logging