• R/O
  • HTTP
  • SSH
  • HTTPS

pg_hint_plan: Commit

firtst release


Commit MetaInfo

Revisionde8e6d9f0178e2a825376e89cbe38a02dae8439c (tree)
Time2020-02-13 14:52:10
AuthorKyotaro Horiguchi <horikyota.ntt@gmai...>
CommiterKyotaro Horiguchi

Log Message

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

Change Summary

Incremental Difference

--- a/pg_hint_plan.c
+++ b/pg_hint_plan.c
@@ -3012,7 +3012,8 @@ pg_hint_plan_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
30123012 * Support for nested plpgsql functions. This is quite ugly but this is the
30133013 * only point I could find where I can get the query string.
30143014 */
3015- if (plpgsql_recurse_level > 0)
3015+ if (plpgsql_recurse_level > 0 &&
3016+ error_context_stack && error_context_stack->arg)
30163017 {
30173018 MemoryContext oldcontext;
30183019
Show on old repository browser