pgsql: Fix handling of strict non-set functions with NULLs in set-value - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix handling of strict non-set functions with NULLs in set-value
Date
Msg-id E1UbZl2-0004kY-F8@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix handling of strict non-set functions with NULLs in set-valued inputs.

In a construct like "select plain_function(set_returning_function(...))",
the plain function is applied to each output row of the SRF successively.
If some of the SRF outputs are NULL, and the plain function is strict,
you'd expect to get NULL results for such rows ... but what actually
happened was that such rows were omitted entirely from the result set.
This was due to confusion of this case with what should happen for nested
set-returning functions; a strict SRF is indeed supposed to yield an empty
set for null input.  Per bug #8150 from Erwin Brandstetter.

Although this has been broken forever, we're not back-patching because
of the possibility that some apps out there expect the incorrect behavior.
This change should be listed as a possible incompatibility in the 9.3
release notes.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/904af8db8a99409257db1eed0b056c8098e9013c

Modified Files
--------------
src/backend/executor/execQual.c      |   10 +++++++++-
src/test/regress/expected/arrays.out |    9 +++++++++
src/test/regress/sql/arrays.sql      |    1 +
3 files changed, 19 insertions(+), 1 deletions(-)


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: pgsql: pgbench: Fix order of options in --help output
Next
From: Tom Lane
Date:
Subject: pgsql: Fix handling of OID wraparound while in standalone mode.