firtst release
Revision | b920371b28ab3db63cc80855ef18aaf5592e30b0 (tree) |
---|---|
Time | 2020-02-13 14:53:38 |
Author | Kyotaro Horiguchi <horikyota.ntt@gmai...> |
Commiter | Kyotaro Horiguchi |
Do null-check of error_context_stack before use
The variable is accessed without null checking when planner is called
in the context of pl/pgsql. Fix it. Back-patched up to pg_hint_plan94.
Reporter: egashira-yusuke
Issue: https://github.com/ossc-db/pg_hint_plan/issues/42
Original-Author: sun-wei <30999182+Dagouhan@users.noreply.github.com>
Original-patch: https://github.com/ossc-db/pg_hint_plan/pull/45/commits/8fe092ef73a9af6cfb41e20717d7cb35aa74fce2
@@ -3014,6 +3014,8 @@ pg_hint_plan_planner(Query *parse, int cursorOptions, ParamListInfo boundParams) | ||
3014 | 3014 | * Support for nested plpgsql functions. This is quite ugly but this is the |
3015 | 3015 | * only point I could find where I can get the query string. |
3016 | 3016 | */ |
3017 | + if (plpgsql_recurse_level > 0 && | |
3018 | + error_context_stack && error_context_stack->arg) | |
3017 | 3019 | if (plpgsql_recurse_level > 0) |
3018 | 3020 | { |
3019 | 3021 | MemoryContext oldcontext; |