OSDN Git Service

Restore current hint state when returned from non-hinted query planning.
authorKyotaro Horiguchi <horikyota.ntt@gmail.com>
Mon, 17 Feb 2020 10:46:28 +0000 (19:46 +0900)
committerKyotaro Horiguchi <horikyota.ntt@gmail.com>
Mon, 17 Feb 2020 12:07:20 +0000 (21:07 +0900)
commit9d0d4e2bb4559097e7bb0d84d71274822ee2fa2c
tree5127cabe5d3406f101a8b84ea1df606ea7197ece
parent7dcc96fd27a7f91545156887faba5907f35da068
Restore current hint state when returned from non-hinted query planning.

If no hint is given for the current level query, pg_hint_plan_planner
calls the next level of planner after erasing the
current_hint_state. But it forgot to restore the state before the
planning of the rest part of the current-level query.  It is
(a-kind-of) broken by the commit d422966 but overlooked as an
inevitable side-effect of the fix.  Get back the behavior by restoring
current_hint_state after returned from the lower level planner with
unhinted query.

Issue: https://github.com/ossc-db/pg_hint_plan/issues/30
Reported-by: higuchi-daisuke
expected/ut-A.out
expected/ut-S.out
pg_hint_plan.c
sql/ut-A.sql