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 04:00:01 +0000 (13:00 +0900)
commit0576a9485c3289d9a3bc49b63654cf8dcbe3fd04
tree349f4d3172571b3b24ce3afcf69a24d939c09036
parent85e97821b11dde0f57f543c0b1f407f871799d9b
Fix crash bug caused by plancache invalidation

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