mirror of
https://github.com/postgres/postgres.git
synced 2025-07-18 17:42:25 +03:00
Allow FDWs to push down quals without breaking EvalPlanQual rechecks.
This fixes a long-standing bug which was discovered while investigating the interaction between the new join pushdown code and the EvalPlanQual machinery: if a ForeignScan appears on the inner side of a paramaterized nestloop, an EPQ recheck would re-return the original tuple even if it no longer satisfied the pushed-down quals due to changed parameter values. This fix adds a new member to ForeignScan and ForeignScanState and a new argument to make_foreignscan, and requires changes to FDWs which push down quals to populate that new argument with a list of quals they have chosen to push down. Therefore, I'm only back-patching to 9.5, even though the bug is not new in 9.5. Etsuro Fujita, reviewed by me and by Kyotaro Horiguchi.
This commit is contained in:
@ -594,6 +594,7 @@ _outForeignScan(StringInfo str, const ForeignScan *node)
|
||||
WRITE_NODE_FIELD(fdw_exprs);
|
||||
WRITE_NODE_FIELD(fdw_private);
|
||||
WRITE_NODE_FIELD(fdw_scan_tlist);
|
||||
WRITE_NODE_FIELD(fdw_recheck_quals);
|
||||
WRITE_BITMAPSET_FIELD(fs_relids);
|
||||
WRITE_BOOL_FIELD(fsSystemCol);
|
||||
}
|
||||
|
Reference in New Issue
Block a user