Fix pushing of quals containing window functions
Fix qual_is_pushdown_safe_set_operation to correctly resolve the qual vars and identify if there are any window references in the top level of the set operation's left or right subqueries. Before commit b8002a9, instead of starting with rte of the level where the qual is attached we started scanning the rte of the subqueries of the left and right args of setop to identify the qual. However, because of this the varno didn't match to the corresponding RTE due to which the quals couldn't be resolved to winref and were incorrectly pushed down. This caused the planner to return an error during execution.
Showing
想要评论请 注册 或 登录