postgresql/src/backend
Tom Lane 9b63c13f0a Repair failure with SubPlans in multi-row VALUES lists.
When nodeValuesscan.c was written, it was impossible to have a SubPlan in
VALUES --- any sub-SELECT there would have to be uncorrelated and thereby
would produce an InitPlan instead.  We therefore took a shortcut in the
logic that throws away a ValuesScan's per-row expression evaluation data
structures.  This was broken by the introduction of LATERAL however; a
sub-SELECT containing a lateral reference produces a correlated SubPlan.

The cleanest fix for this would be to give up the optimization of
discarding the expression eval state.  But that still seems pretty
unappetizing for long VALUES lists.  It seems to work to just prevent
the subexpressions from hooking into the ValuesScan node's subPlan
list, so let's do that and see how well it works.  (If this breaks,
due to additional connections between the subexpressions and the outer
query structures, we might consider compromises like throwing away data
only for VALUES rows not containing SubPlans.)

Per bug #14924 from Christian Duta.  Back-patch to 9.3 where LATERAL
was introduced.

Discussion: https://postgr.es/m/20171124120836.1463.5310@wrigleys.postgresql.org
2017-11-25 14:15:48 -05:00
..
access Parameter toast_tuple_target controls TOAST for new rows 2017-11-20 09:50:10 +11:00
bootstrap Exclude flex-generated code from coverage testing 2017-10-16 16:28:11 -04:00
catalog Fix multiple problems with satisfies_hash_partition. 2017-11-21 13:06:32 -05:00
commands Pass InitPlan values to workers via Gather (Merge). 2017-11-16 12:06:14 -05:00
executor Repair failure with SubPlans in multi-row VALUES lists. 2017-11-25 14:15:48 -05:00
foreign Change TRUE/FALSE to true/false 2017-11-08 11:37:28 -05:00
lib Allow to avoid NUL-byte management for stringinfos and use in format.c. 2017-10-11 16:01:52 -07:00
libpq Support channel binding 'tls-unique' in SCRAM 2017-11-18 10:15:54 -05:00
main Install Windows crash dump handler before all else. 2017-11-12 14:31:00 -08:00
nodes Pass InitPlan values to workers via Gather (Merge). 2017-11-16 12:06:14 -05:00
optimizer Improve planner's handling of set-returning functions in grouping columns. 2017-11-25 11:48:09 -05:00
parser Add some const decorations to prototypes 2017-11-10 13:38:57 -05:00
po Translation updates 2017-08-07 13:55:34 -04:00
port Add some const decorations to prototypes 2017-11-10 13:38:57 -05:00
postmaster Provide for forward compatibility with future minor protocol versions. 2017-11-21 13:56:24 -05:00
regex Mop-up for commit 85feb77aa0. 2017-09-22 11:35:12 -04:00
replication Generational memory allocator 2017-11-23 05:45:07 +11:00
rewrite RLS comment fixes. 2017-11-24 14:14:40 +00:00
snowball Add some const decorations to prototypes 2017-11-10 13:38:57 -05:00
statistics Infer functional dependency past RelabelType 2017-10-12 17:23:47 +02:00
storage Update buffile.h/.c comments for removal of non-temp option. 2017-11-25 13:19:43 -05:00
tcop Back out the session_start and session_end hooks feature. 2017-11-16 11:35:02 -05:00
tsearch Add some const decorations to prototypes 2017-11-10 13:38:57 -05:00
utils Improve planner's handling of set-returning functions in grouping columns. 2017-11-25 11:48:09 -05:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Add ICU_CFLAGS to global CPPFLAGS 2017-06-12 15:57:22 -04:00
Makefile Inject $(ICU_LIBS) regardless of platform. 2017-08-20 21:22:18 -07:00
nls.mk Translation updates 2017-05-15 12:19:54 -04:00