OSDN Git Service

Follow the semantic change of pg_list part 2
authorKyotaro Horiguchi <horikyoga.ntt@gmail.com>
Wed, 28 Oct 2020 09:00:28 +0000 (18:00 +0900)
committerKyotaro Horiguchi <horikyoga.ntt@gmail.com>
Thu, 29 Oct 2020 11:31:47 +0000 (20:31 +0900)
Commit 7ed93ce forgot to fix another place where list_delete_cell() is
used. Fix it.

pg_hint_plan.c

index 8eef7ef..29e3e6a 100644 (file)
@@ -3609,9 +3609,9 @@ restrict_indexes(PlannerInfo *root, ScanMethodHint *hint, RelOptInfo *rel,
                        rel->indexlist = list_delete_cell(rel->indexlist, cell);
 
                        /*
-                        * the elements after cell moved to the list head by 1 element.
-                        * the next iteration should visit the cell at the same address if
-                        * any.
+                        * The cells after the deleted cell have been moved towards the
+                        * list head by 1 element.  the next iteration should visit the
+                        * cell at the same address if any.
                         */
                        if (next)
                                next = cell;
@@ -4403,6 +4403,14 @@ transform_join_hints(HintState *hstate, PlannerInfo *root, int nbaserel,
                                        {
                                                hstate->join_hint_level[i] =
                                                        list_delete_cell(hstate->join_hint_level[i], l);
+                                               /*
+                                                * The cells after the deleted cell have been moved
+                                                * towards the list head by 1 element.  the next
+                                                * iteration should visit the cell at the same address
+                                                * if any.
+                                                */
+                                               if (next)
+                                                       next = l;
                                        }
                                }
                        }