]> granicus.if.org Git - postgresql/commit
Only try to push down foreign joins if the user mapping OIDs match.
authorRobert Haas <rhaas@postgresql.org>
Thu, 28 Jan 2016 19:05:36 +0000 (14:05 -0500)
committerRobert Haas <rhaas@postgresql.org>
Thu, 28 Jan 2016 19:05:36 +0000 (14:05 -0500)
commitfbe5a3fb73102c2cfec11aaaa4a67943f4474383
tree44b327ff5aaceb5a20346ee4c914914450e51368
parent2f6b041f76e6de0fa2921131a23bda794ffb83bb
Only try to push down foreign joins if the user mapping OIDs match.

Previously, the foreign join pushdown infrastructure left the question
of security entirely up to individual FDWs, but it would be easy for
a foreign data wrapper to inadvertently open up subtle security holes
that way.  So, make it the core code's job to determine which user
mapping OID is relevant, and don't attempt join pushdown unless it's
the same for all relevant relations.

Per a suggestion from Tom Lane.  Shigeru Hanada and Ashutosh Bapat,
reviewed by Etsuro Fujita and KaiGai Kohei, with some further
changes by me.
13 files changed:
src/backend/executor/execParallel.c
src/backend/foreign/foreign.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/outfuncs.c
src/backend/nodes/readfuncs.c
src/backend/optimizer/plan/createplan.c
src/backend/optimizer/plan/planner.c
src/backend/optimizer/util/relnode.c
src/backend/utils/cache/plancache.c
src/include/foreign/foreign.h
src/include/nodes/plannodes.h
src/include/nodes/relation.h
src/include/utils/plancache.h