mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-18 18:44:06 +08:00
Now that I look at it, int_array_enum() didn't work either.
This commit is contained in:
parent
4d43341043
commit
5f0962a233
@ -201,6 +201,10 @@ int_enum(PG_FUNCTION_ARGS)
|
||||
if (!fcinfo->context)
|
||||
{
|
||||
/* Allocate a working context */
|
||||
MemoryContext oldcontext;
|
||||
|
||||
oldcontext = MemoryContextSwitchTo(fcinfo->flinfo->fn_mcxt);
|
||||
|
||||
pc = (CTX *) palloc(sizeof(CTX));
|
||||
|
||||
/* Don't copy attribute if you don't need to */
|
||||
@ -218,6 +222,7 @@ int_enum(PG_FUNCTION_ARGS)
|
||||
}
|
||||
pc->num = 0;
|
||||
fcinfo->context = (Node *) pc;
|
||||
MemoryContextSwitchTo(oldcontext);
|
||||
}
|
||||
else /* use an existing one */
|
||||
pc = (CTX *) fcinfo->context;
|
||||
|
Loading…
Reference in New Issue
Block a user