OSDN Git Service
(root)
/
pg-rex
/
syncrep.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
368964e
)
Now that I look at it, int_array_enum() didn't work either.
author
Tom Lane
<tgl@sss.pgh.pa.us>
Thu, 27 Jan 2005 21:49:57 +0000
(21:49 +0000)
committer
Tom Lane
<tgl@sss.pgh.pa.us>
Thu, 27 Jan 2005 21:49:57 +0000
(21:49 +0000)
contrib/intagg/int_aggregate.c
patch
|
blob
|
history
diff --git
a/contrib/intagg/int_aggregate.c
b/contrib/intagg/int_aggregate.c
index
67056af
..
cb0f1f3
100644
(file)
--- a/
contrib/intagg/int_aggregate.c
+++ b/
contrib/intagg/int_aggregate.c
@@
-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;