From 5f0969f4977cf8b83db88c6f3c5502a8e89f65d2 Mon Sep 17 00:00:00 2001 From: Kyotaro Horiguchi Date: Wed, 28 Oct 2020 18:00:28 +0900 Subject: [PATCH] Follow the semantic change of pg_list part 2 Commit 7ed93ce forgot to fix another place where list_delete_cell() is used. Fix it. --- pg_hint_plan.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pg_hint_plan.c b/pg_hint_plan.c index 8eef7ef..29e3e6a 100644 --- a/pg_hint_plan.c +++ b/pg_hint_plan.c @@ -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; } } } -- 2.11.0