Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite6a3012

Browse files
committed
int_array_enum function should be using fcinfo->flinfo->fn_extra for
working state, not fcinfo->context. Silly oversight on my part in lastgo-round of fixes.
1 parent87808ae commite6a3012

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

‎contrib/intagg/int_aggregate.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,9 @@ int_enum(PG_FUNCTION_ARGS)
220220
PG_RETURN_NULL();
221221
}
222222

223-
if (!fcinfo->context)
223+
if (!fcinfo->flinfo->fn_extra)
224224
{
225-
/* Allocateaworkingcontext */
225+
/* Allocate workingstate */
226226
MemoryContextoldcontext;
227227

228228
oldcontext=MemoryContextSwitchTo(fcinfo->flinfo->fn_mcxt);
@@ -247,19 +247,20 @@ int_enum(PG_FUNCTION_ARGS)
247247
if (pc->p->a.ndim>1)
248248
elog(ERROR,"int_enum only accepts 1-D arrays");
249249
pc->num=0;
250-
fcinfo->context= (Node*)pc;
250+
fcinfo->flinfo->fn_extra= (void*)pc;
251251
MemoryContextSwitchTo(oldcontext);
252252
}
253-
else/* use an existing one */
254-
pc= (CTX*)fcinfo->context;
253+
else/* use existing working state */
254+
pc= (CTX*)fcinfo->flinfo->fn_extra;
255+
255256
/* Are we done yet? */
256257
if (pc->p->a.ndim<1||pc->num >=pc->p->items)
257258
{
258259
/* We are done */
259260
if (pc->flags&TOASTED)
260261
pfree(pc->p);
261-
pfree(fcinfo->context);
262-
fcinfo->context=NULL;
262+
pfree(pc);
263+
fcinfo->flinfo->fn_extra=NULL;
263264
rsi->isDone=ExprEndResult;
264265
}
265266
else

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp