postgresql/src
Tom Lane a8725c2bad Fix eclass_useful_for_merging to give valid results for appendrel children.
Formerly, this function would always return "true" for an appendrel child
relation, because it would think that the appendrel parent was a potential
join target for the child.  In principle that should only lead to some
inefficiency in planning, but fuzz testing by Andreas Seltenreich disclosed
that it could lead to "could not find pathkey item to sort" planner errors
in odd corner cases.  Specifically, we would think that all columns of a
child table's multicolumn index were interesting pathkeys, causing us to
generate a MergeAppend path that sorts by all the columns.  However, if any
of those columns weren't actually used above the level of the appendrel,
they would not get added to that rel's targetlist, which would result in
being unable to resolve the MergeAppend's sort keys against its targetlist
during createplan.c.

Backpatch to 9.3.  In older versions, columns of an appendrel get added
to its targetlist even if they're not mentioned above the scan level,
so that the failure doesn't occur.  It might be worth back-patching this
fix to older versions anyway, but I'll refrain for the moment.
2015-08-06 20:14:54 -04:00
..
backend Fix eclass_useful_for_merging to give valid results for appendrel children. 2015-08-06 20:14:54 -04:00
bin Improve includes introduced in the replication origins patch. 2015-08-06 12:41:59 +02:00
common
include Fix eclass_useful_for_merging to give valid results for appendrel children. 2015-08-06 20:14:54 -04:00
interfaces Translation updates 2015-08-03 14:10:33 -04:00
makefiles Link $(WIN32RES) into single-file modules only when PGFILEDESC is set. 2015-08-05 20:45:21 -04:00
pl Translation updates 2015-08-03 14:10:33 -04:00
port Redesign tablesample method API, and do extensive code review. 2015-07-25 14:39:00 -04:00
template AIX: Test the -qlonglong option before use. 2015-07-17 03:01:29 -04:00
test Fix eclass_useful_for_merging to give valid results for appendrel children. 2015-08-06 20:14:54 -04:00
timezone
tools MSVC: Revert most 9.5 changes to pre-9.5 vcregress.pl tests. 2015-07-29 22:52:00 -04:00
tutorial
.gitignore
bcc32.mak
DEVELOPERS
Makefile
Makefile.global.in Consolidate makefile code for setting top_srcdir, srcdir and VPATH. 2015-07-30 20:49:18 -04:00
Makefile.shlib AIX: Link TRANSFORM modules with their dependencies. 2015-07-15 21:00:30 -04:00
nls-global.mk
win32.mak