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:08:15 +0000 (21:08 +0900)
commit1d86d3b185ec7508f76e0218cc9a0dcaf2053d72
tree044e5eb22328730cbd6c1aca06f1b0d6fa603b9d
parentef5e86487f2df6b551e75102ce1a187231e4c671
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
pg_hint_plan.c
sql/ut-A.sql