mirror of
https://github.com/postgres/postgres.git
synced 2025-07-03 20:02:46 +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:
@ -770,6 +770,12 @@ add_partial_path(RelOptInfo *parent_rel, Path *new_path)
|
||||
/* Check for query cancel. */
|
||||
CHECK_FOR_INTERRUPTS();
|
||||
|
||||
/* Path to be added must be parallel safe. */
|
||||
Assert(new_path->parallel_safe);
|
||||
|
||||
/* Relation should be OK for parallelism, too. */
|
||||
Assert(parent_rel->consider_parallel);
|
||||
|
||||
/*
|
||||
* As in add_path, throw out any paths which are dominated by the new
|
||||
* path, but throw out the new path if some existing path dominates it.
|
||||
|
Reference in New Issue
Block a user