git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 3b81617) | patch
Wrap appendrel member outputs in PlaceHolderVars in additional cases.
Wed, 9 Nov 2011 02:14:21 +0000 (21:14 -0500)
Wed, 9 Nov 2011 02:14:21 +0000 (21:14 -0500)
commit 57664ed25e5dea117158a2e663c29e60b3546e1c
Wrap appendrel member outputs in PlaceHolderVars in additional cases.

Add PlaceHolderVar wrappers as needed to make UNION ALL sub-select output
expressions appear non-constant and distinct from each other. This makes
the world safe for add_child_rel_equivalences to do what it does. Before,
it was possible for that function to add identical expressions to different
EquivalenceClasses, which logically should imply merging such ECs, which
would be wrong; or to improperly add a constant to an EquivalenceClass,
drastically changing its behavior. Per report from Teodor Sigaev.

The only currently known consequence of this bug is "MergeAppend child's
targetlist doesn't match MergeAppend" planner failures in 9.1 and later.
I am suspicious that there may be other failure modes that could affect
older release branches; but in the absence of any hard evidence, I'll
refrain from back-patching further than 9.1.
src/backend/optimizer/plan/planmain.c diff | blob | blame | history
src/backend/optimizer/prep/prepjointree.c diff | blob | blame | history
src/backend/optimizer/util/placeholder.c diff | blob | blame | history
src/include/optimizer/placeholder.h diff | blob | blame | history
src/test/regress/expected/inherit.out diff | blob | blame | history
src/test/regress/sql/inherit.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /