Re: Fix NULL pointer reference in _outPathTarget()

From: Richard Guo <guofenglinux(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fix NULL pointer reference in _outPathTarget()
Date: 2022-04-19 02:51:49
Message-ID: CAMbWs49YsmX6Y_sKC1BqPMHFY0Ai1etp3wT-ma0dTL=XpRppFw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Apr 19, 2022 at 2:53 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2022-04-19 02:59:16 Re: Handle infinite recursion in logical replication setup
Previous Message Michael Paquier 2022-04-19 02:43:13 Re: Postgres perl module namespace