Empty partial_pathlist when unsetting consider_parallel flag

It's not valid for a RelOptInfo to have a non-empty partial_pathlist
when its consider_parallel is true.  In set_append_rel_pathlist() when
we see the parent rel doesn't have consider_parallel set, we set that
property to false for the child.  It is possible that the child already
has some partial paths at that point, so we need to nullify that list as
well as set the consider_parallel flag to false.

For the reported problem case, the partial paths had been created during
set_subquery_pathlist().  These not being empty was causing an Assert
failure on cassert builds.  I think this could only have gone on to
result in some wasted planner effort in non-cassert builds, but cannot
confirm if anything worse could have happened.

Bug: #19803
Reported-by: Gowtham Reddy <[email protected]>
Author: David Rowley <[email protected]>
Tested-by: Gowtham Reddy <[email protected]>
Discussion: https://postgr.es/m/[email protected]
Backpatch-through: 14

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/abda2a2c9b2a76687513ef223f782b333951149f

Modified Files
--------------
src/backend/optimizer/path/allpaths.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

Reply via email to