mirror of
https://github.com/postgres/postgres.git
synced 2025-11-21 00:42:43 +03:00
Prevent generation of bogus subquery scan paths.
Commit 0927d2f46d didn't check that
consider_parallel was set for the target relation or account for
the possibility that required_outer might be non-empty.
To prevent future bugs of this ilk, add some assertions to
add_partial_path and do a bit of future-proofing of the code
recently added to recurse_set_operations.
Report by Andreas Seltenreich. Patch by Jeevan Chalke. Review
by Amit Kapila and by me.
Discussion: http://postgr.es/m/CAM2+6=U+9otsyF2fYB8x_2TBeHTR90itarqW=qAEjN-kHaC7kw@mail.gmail.com
This commit is contained in:
@@ -330,7 +330,8 @@ recurse_set_operations(Node *setOp, PlannerInfo *root,
|
||||
* to build a partial path for this relation. But there's no point in
|
||||
* considering any path but the cheapest.
|
||||
*/
|
||||
if (final_rel->partial_pathlist != NIL)
|
||||
if (rel->consider_parallel && bms_is_empty(rel->lateral_relids) &&
|
||||
final_rel->partial_pathlist != NIL)
|
||||
{
|
||||
Path *partial_subpath;
|
||||
Path *partial_path;
|
||||
|
||||
Reference in New Issue
Block a user