postgresql/src
Tom Lane dd3bab5fd7 Ensure that whole-row junk Vars are always of composite type.
The EvalPlanQual machinery assumes that whole-row Vars generated for the
outputs of non-table RTEs will be of composite types.  However, for the
case where the RTE is a function call returning a scalar type, we were
doing the wrong thing, as a result of sharing code with a parser case
where the function's scalar output is wanted.  (Or at least, that's what
that case has done historically; it does seem a bit inconsistent.)

To fix, extend makeWholeRowVar's API so that it can support both use-cases.
This fixes Belinda Cussen's report of crashes during concurrent execution
of UPDATEs involving joins to the result of UNNEST() --- in READ COMMITTED
mode, we'd run the EvalPlanQual machinery after a conflicting row update
commits, and it was expecting to get a HeapTuple not a scalar datum from
the "wholerowN" variable referencing the function RTE.

Back-patch to 9.0 where the current EvalPlanQual implementation appeared.

In 9.1 and up, this patch also fixes failure to attach the correct
collation to the Var generated for a scalar-result case.  An example:
regression=# select upper(x.*) from textcat('ab', 'cd') x;
ERROR:  could not determine which collation to use for upper() function
2011-11-27 22:27:24 -05:00
..
backend Ensure that whole-row junk Vars are always of composite type. 2011-11-27 22:27:24 -05:00
bin Move pg_dump memory routines into pg_dumpmem.c/h and restore common.c 2011-11-26 22:34:36 -05:00
include Ensure that whole-row junk Vars are always of composite type. 2011-11-27 22:27:24 -05:00
interfaces Applied Zoltan's patch to correctly align interval and timestamp data in ecpg's sqlda. 2011-11-17 14:07:25 +01:00
makefiles Add pg_upgrade test suite 2011-11-27 22:42:32 +02:00
pl Use the proper macro to convert a bool to a Datum. 2011-11-27 12:57:11 -05:00
port Fix join_path_components() to not add a leading slash when joining to an 2011-11-26 09:27:11 -05:00
template Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
test Improve GiST range-contained-by searches by adding a flag for empty ranges. 2011-11-27 16:51:29 -05:00
timezone Update docs to point to the timezone library's new home at IANA. 2011-10-27 23:09:05 -04:00
tools Make pg_dumpall build with the right object files under MSVC. 2011-11-27 20:14:47 -05:00
tutorial Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Fix some oversights in distprep and maintainer-clean targets. 2011-03-10 00:04:05 -05:00
Makefile.global.in Make distprep and *clean build targets recurse into all subdirectories. 2011-07-03 13:55:12 -04:00
Makefile.shlib Use single quotes in preference to double quotes for protecting pathnames. 2011-06-15 21:45:23 -04:00
nls-global.mk Add the possibility to pass --flag arguments to xgettext calls 2011-06-27 00:37:21 +03:00
win32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00