During manipulation on pathlist of a GatherPath, foreach was mitakenly
used for a loop using list_delete_cell. This leads to a crash with
SEGV.
/* also remove gather path */
if (rel->pathlist)
{
- ListCell *cell, *prev = NULL;
+ ListCell *cell, *prev = NULL, *next;
- foreach (cell, rel->pathlist)
+ for (cell = list_head(rel->pathlist) ; cell; cell = next)
{
Path *path = (Path *) lfirst(cell);
-
+
+ next = lnext(cell);
if (IsA(path, GatherPath))
rel->pathlist = list_delete_cell(rel->pathlist,
cell, prev);