Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 368964e commit 728775dCopy full SHA for 728775d
contrib/intagg/int_aggregate.c
@@ -201,6 +201,10 @@ int_enum(PG_FUNCTION_ARGS)
201
if (!fcinfo->context)
202
{
203
/* Allocate a working context */
204
+ MemoryContext oldcontext;
205
+
206
+ oldcontext = MemoryContextSwitchTo(fcinfo->flinfo->fn_mcxt);
207
208
pc = (CTX *) palloc(sizeof(CTX));
209
210
/* Don't copy attribute if you don't need to */
@@ -218,6 +222,7 @@ int_enum(PG_FUNCTION_ARGS)
218
222
}
219
223
pc->num = 0;
220
224
fcinfo->context = (Node *) pc;
225
+ MemoryContextSwitchTo(oldcontext);
221
226
227
else /* use an existing one */
228
pc = (CTX *) fcinfo->context;
0 commit comments