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:43:50 +0000 (15:43 +0900)
commitceb5af4e8d1baaf04faeee21c602bddb1dc75e4c
tree940fdcb91ade121d05dfc8126087954f500926d6
parent99aece79ce2ce0b23f6d7390825025418c4f3dd9
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