Commit ddef9a00 authored by Robert Haas's avatar Robert Haas

Fix a few small bugs in yesterday's event trigger patch.

Dimitri Fontaine
parent 4c977319
...@@ -551,7 +551,7 @@ filter_event_trigger(const char **tag, EventTriggerCacheItem *item) ...@@ -551,7 +551,7 @@ filter_event_trigger(const char **tag, EventTriggerCacheItem *item)
} }
/* Filter by tags, if any were specified. */ /* Filter by tags, if any were specified. */
if (item->ntags != 0 && bsearch(&tag, item->tag, if (item->ntags != 0 && bsearch(tag, item->tag,
item->ntags, sizeof(char *), item->ntags, sizeof(char *),
pg_qsort_strcmp) == NULL) pg_qsort_strcmp) == NULL)
return false; return false;
...@@ -752,6 +752,9 @@ EventTriggerInvoke(List *fn_oid_list, EventTriggerData *trigdata) ...@@ -752,6 +752,9 @@ EventTriggerInvoke(List *fn_oid_list, EventTriggerData *trigdata)
ListCell *lc; ListCell *lc;
bool first = true; bool first = true;
/* Guard against stack overflow due to recursive event trigger */
check_stack_depth();
/* /*
* Let's evaluate event triggers in their own memory context, so * Let's evaluate event triggers in their own memory context, so
* that any leaks get cleaned up promptly. * that any leaks get cleaned up promptly.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment