diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-08-15 19:05:16 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-08-15 19:05:16 +0000 |
commit | e6a30121be93c7d66e704d0b449e124c0fdd0127 (patch) | |
tree | bb3c67d17a70a07b7031b7e3353c8a928724fe22 | |
parent | 87808aef05c91bdd26cb4447489db8a35c0d6fb2 (diff) | |
download | postgresql-e6a30121be93c7d66e704d0b449e124c0fdd0127.tar.gz postgresql-e6a30121be93c7d66e704d0b449e124c0fdd0127.zip |
int_array_enum function should be using fcinfo->flinfo->fn_extra for
working state, not fcinfo->context. Silly oversight on my part in last
go-round of fixes.
-rw-r--r-- | contrib/intagg/int_aggregate.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/contrib/intagg/int_aggregate.c b/contrib/intagg/int_aggregate.c index df2bd1e0336..f4391b46996 100644 --- a/contrib/intagg/int_aggregate.c +++ b/contrib/intagg/int_aggregate.c @@ -220,9 +220,9 @@ int_enum(PG_FUNCTION_ARGS) PG_RETURN_NULL(); } - if (!fcinfo->context) + if (!fcinfo->flinfo->fn_extra) { - /* Allocate a working context */ + /* Allocate working state */ MemoryContext oldcontext; oldcontext = MemoryContextSwitchTo(fcinfo->flinfo->fn_mcxt); @@ -247,19 +247,20 @@ int_enum(PG_FUNCTION_ARGS) if (pc->p->a.ndim > 1) elog(ERROR, "int_enum only accepts 1-D arrays"); pc->num = 0; - fcinfo->context = (Node *) pc; + fcinfo->flinfo->fn_extra = (void *) pc; MemoryContextSwitchTo(oldcontext); } - else /* use an existing one */ - pc = (CTX *) fcinfo->context; + else /* use existing working state */ + pc = (CTX *) fcinfo->flinfo->fn_extra; + /* Are we done yet? */ if (pc->p->a.ndim < 1 || pc->num >= pc->p->items) { /* We are done */ if (pc->flags & TOASTED) pfree(pc->p); - pfree(fcinfo->context); - fcinfo->context = NULL; + pfree(pc); + fcinfo->flinfo->fn_extra = NULL; rsi->isDone = ExprEndResult; } else |