OSDN Git Service

Fix crash bug caused by plancache invalidation
authorKyotaro Horiguchi <horikyota.ntt@gmail.com>
Fri, 14 Feb 2020 03:34:55 +0000 (12:34 +0900)
committerKyotaro Horiguchi <horikyota.ntt@gmail.com>
Fri, 14 Feb 2020 06:57:39 +0000 (15:57 +0900)
commitbe1a68fd05ce4b307ba660cdfb2d74830a79267f
treeb406da0dea6a5bfb2a6061e828dd509193bed3d0
parent4e3c9871ca22d4a5916c1d659787bca3cb09a184
Fix crash bug caused by plancache invalidation

Issue: https://github.com/ossc-db/pg_hint_plan/issues/41

After plancache is invalidated then revaliated, get_query_string
accesses query_list of invalid plansource then crash. Ignore invalid
plancache and get the correct hint string and Query node at the next
planning time during revalidation.

On the way fixing this, a bug related to planner reentrance is
fixed. That fix causes behavioral change for nested
planning. Previously outer-level hint (wrongly) overrides inner-level
query but currenlty outer-level hint no longer affects inner-level
query.
expected/ut-A.out
pg_hint_plan.c
sql/ut-A.sql