Re: Fix NULL pointer reference in _outPathTarget()
Richard Guo <guofenglinux@gmail.com>
From: Richard Guo <guofenglinux@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>, Pg Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-04-19T02:51:49Z
Lists: 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
Commits
-
Handle NULL fields in WRITE_INDEX_ARRAY
- 9ddf251f9409 15.0 landed