aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/executor/execGrouping.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/backend/executor/execGrouping.c b/src/backend/executor/execGrouping.c
index c4d0e040587..271bba17e40 100644
--- a/src/backend/executor/execGrouping.c
+++ b/src/backend/executor/execGrouping.c
@@ -208,11 +208,17 @@ BuildTupleHashTable(PlanState *parent,
hashtable->tab_eq_func = ExecBuildGroupingEqual(inputDesc, inputDesc,
numCols,
keyColIdx, eqfuncoids,
- parent);
+ NULL);
- MemoryContextSwitchTo(oldcontext);
+ /*
+ * While not pretty, it's ok to not shut down this context, but instead
+ * rely on the containing memory context being reset, as
+ * ExecBuildGroupingEqual() only builds a very simple expression calling
+ * functions (i.e. nothing that'd employ RegisterExprContextCallback()).
+ */
+ hashtable->exprcontext = CreateStandaloneExprContext();
- hashtable->exprcontext = CreateExprContext(parent->state);
+ MemoryContextSwitchTo(oldcontext);
return hashtable;
}