Re: Fix NULL pointer reference in _outPathTarget() - Mailing list pgsql-hackers

From Richard Guo
Subject Re: Fix NULL pointer reference in _outPathTarget()
Date
Msg-id CAMbWs49YsmX6Y_sKC1BqPMHFY0Ai1etp3wT-ma0dTL=XpRppFw@mail.gmail.com
Whole thread Raw
In response to Re: Fix NULL pointer reference in _outPathTarget()  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

On Tue, Apr 19, 2022 at 2:53 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:

A semantics-preserving conversion would have looked something like

    if (node->sortgrouprefs)
        WRITE_INDEX_ARRAY(sortgrouprefs, list_length(node->exprs));

I suppose that Peter was trying to remove special cases from the
outfuncs.c code, but do we want to put this one back?  Richard's
proposal would not accurately reflect the contents of the data
structure, so I'm not too thrilled with it.

The commit message in bdeb2c4ec mentions that:

"
This also changes the behavior slightly: Before, the field name was
skipped if the length was zero.  Now it prints the field name even in
that case.  This is more consistent with how other array fields are
handled.
"

So I suppose we are trying to print the field name even if the length is
zero. Should we keep this behavior in the fix?

Thanks
Richard

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Postgres perl module namespace
Next
From: Peter Smith
Date:
Subject: Re: Handle infinite recursion in logical replication setup