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 07:31:26 +0000 (16:31 +0900)
commitca7d497e3ebddf9c2a4837cc05baa501136fc364
tree6e25bca053a47845325e36386c2ffed4bd807241
parenteb2d8f38945415d347e580f8dedaa860ae5bd181
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