diff options
author | Amit Kapila <akapila@postgresql.org> | 2018-06-22 08:43:36 +0530 |
---|---|---|
committer | Amit Kapila <akapila@postgresql.org> | 2018-06-22 08:43:36 +0530 |
commit | 98d476a965eefb52af53f4fb55dbfead0ede9282 (patch) | |
tree | 12c4814d523a180599d16e594b3738525236c6c4 /src/backend/optimizer/util/pathnode.c | |
parent | c7048977a73b4ab3b38b9a28bc58e600b598c176 (diff) | |
download | postgresql-98d476a965eefb52af53f4fb55dbfead0ede9282.tar.gz postgresql-98d476a965eefb52af53f4fb55dbfead0ede9282.zip |
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
Diffstat (limited to 'src/backend/optimizer/util/pathnode.c')
-rw-r--r-- | src/backend/optimizer/util/pathnode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c index e190ad49d16..dbf9adcdaca 100644 --- a/src/backend/optimizer/util/pathnode.c +++ b/src/backend/optimizer/util/pathnode.c @@ -1274,7 +1274,7 @@ create_append_path(PlannerInfo *root, pathnode->first_partial_path = list_length(subpaths); pathnode->subpaths = list_concat(subpaths, partial_subpaths); - foreach(l, subpaths) + foreach(l, pathnode->subpaths) { Path *subpath = (Path *) lfirst(l); |