Re: BUG #7808: unnest doesn't handle nulls in array of composite typescorrectly

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #7808: unnest doesn't handle nulls in array of composite typescorrectly
Date: 2016-07-27 03:59:50
Message-ID: 8737mvn3ag.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

>>>>> "Tom" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

Tom> I didn't much like the "initial_nulls" counter in your patch, but
Tom> actually there's no reason we can't just push an all-nulls row
Tom> into the tuplestore immediately on seeing a null, the same way as
Tom> happens in the last-ditch case at the bottom of
Tom> ExecMakeTableFunctionResult. I whacked that around a bit and
Tom> pushed it.

I did think about that, but the existing code seems to go out of its way
to build the tuplestore using the tupdesc obtained from the actual
function result row, rather than the "expected" tupdesc, and it wasn't
really obvious why that was.

--
Andrew (irc:RhodiumToad)

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2016-07-27 12:48:52 Re: BUG #7808: unnest doesn't handle nulls in array of composite typescorrectly
Previous Message Bruce Momjian 2016-07-27 02:32:13 Re: BUG #14226: pg_upgrade for 8.4 to 9.4 failed