mirror of
https://github.com/postgres/postgres.git
synced 2025-12-21 05:21:08 +03:00
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.
This commit is contained in:
@@ -135,6 +135,7 @@ typedef struct CachedPlan
|
||||
* changes from this value */
|
||||
int generation; /* parent's generation number for this plan */
|
||||
int refcount; /* count of live references to this struct */
|
||||
bool has_foreign_join; /* plan has pushed down a foreign join */
|
||||
MemoryContext context; /* context containing this CachedPlan */
|
||||
} CachedPlan;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user