PG-204: Fix save previous emit_log_hook.

pg_stat_monitor was not saving the pointer to the previous hook for
emit_log_hook, this commit fix the issue.
pull/100/head
Diego Fronza 2021-07-27 14:16:17 -04:00
parent 81a2c705b6
commit b8198278cd
1 changed files with 4 additions and 2 deletions

View File

@ -293,6 +293,7 @@ _PG_init(void)
planner_hook_next = planner_hook; planner_hook_next = planner_hook;
planner_hook = HOOK(pgss_planner_hook); planner_hook = HOOK(pgss_planner_hook);
#endif #endif
prev_emit_log_hook = emit_log_hook;
emit_log_hook = HOOK(pgsm_emit_log_hook); emit_log_hook = HOOK(pgsm_emit_log_hook);
prev_ExecutorCheckPerms_hook = ExecutorCheckPerms_hook; prev_ExecutorCheckPerms_hook = ExecutorCheckPerms_hook;
ExecutorCheckPerms_hook = HOOK(pgss_ExecutorCheckPerms); ExecutorCheckPerms_hook = HOOK(pgss_ExecutorCheckPerms);
@ -317,6 +318,7 @@ _PG_fini(void)
ExecutorFinish_hook = prev_ExecutorFinish; ExecutorFinish_hook = prev_ExecutorFinish;
ExecutorEnd_hook = prev_ExecutorEnd; ExecutorEnd_hook = prev_ExecutorEnd;
ProcessUtility_hook = prev_ProcessUtility; ProcessUtility_hook = prev_ProcessUtility;
emit_log_hook = prev_emit_log_hook;
free(nested_queryids); free(nested_queryids);
regfree(&preg_query_comments); regfree(&preg_query_comments);