Commit 98d476a9 authored by Amit Kapila's avatar Amit Kapila

Improve coding pattern in Parallel Append code.

The create_append_path code didn't consider that list_concat will
modify it's first argument leading to inconsistent traversal of
resulting list.  In practice, it won't lead to any user-visible bug
but changing it for making the code behave consistently.

Reported-by: Tom Lane
Author: Tom Lane
Reviewed-by: Amit Khandekar and Amit Kapila
Discussion: https://postgr.es/m/32365.1528994120@sss.pgh.pa.us
parent c7048977
...@@ -1274,7 +1274,7 @@ create_append_path(PlannerInfo *root, ...@@ -1274,7 +1274,7 @@ create_append_path(PlannerInfo *root,
pathnode->first_partial_path = list_length(subpaths); pathnode->first_partial_path = list_length(subpaths);
pathnode->subpaths = list_concat(subpaths, partial_subpaths); pathnode->subpaths = list_concat(subpaths, partial_subpaths);
foreach(l, subpaths) foreach(l, pathnode->subpaths)
{ {
Path *subpath = (Path *) lfirst(l); Path *subpath = (Path *) lfirst(l);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment