File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -220,9 +220,9 @@ int_enum(PG_FUNCTION_ARGS)
220
220
PG_RETURN_NULL ();
221
221
}
222
222
223
- if (!fcinfo -> context )
223
+ if (!fcinfo -> flinfo -> fn_extra )
224
224
{
225
- /* Allocate a working context */
225
+ /* Allocate working state */
226
226
MemoryContext oldcontext ;
227
227
228
228
oldcontext = MemoryContextSwitchTo (fcinfo -> flinfo -> fn_mcxt );
@@ -247,19 +247,20 @@ int_enum(PG_FUNCTION_ARGS)
247
247
if (pc -> p -> a .ndim > 1 )
248
248
elog (ERROR , "int_enum only accepts 1-D arrays" );
249
249
pc -> num = 0 ;
250
- fcinfo -> context = (Node * ) pc ;
250
+ fcinfo -> flinfo -> fn_extra = (void * ) pc ;
251
251
MemoryContextSwitchTo (oldcontext );
252
252
}
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
+
255
256
/* Are we done yet? */
256
257
if (pc -> p -> a .ndim < 1 || pc -> num >= pc -> p -> items )
257
258
{
258
259
/* We are done */
259
260
if (pc -> flags & TOASTED )
260
261
pfree (pc -> p );
261
- pfree (fcinfo -> context );
262
- fcinfo -> context = NULL ;
262
+ pfree (pc );
263
+ fcinfo -> flinfo -> fn_extra = NULL ;
263
264
rsi -> isDone = ExprEndResult ;
264
265
}
265
266
else
You can’t perform that action at this time.
0 commit comments