From 3e65431bc1a722c5d7e1a7598f3b18f9b3224ace Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 24 Mar 2005 21:51:04 +0000 Subject: array_map can't use the fn_extra field of the provided fcinfo struct as its private storage, because that belongs to the function that it is supposed to call. Per report from Ezequiel Tolnay. --- src/include/utils/array.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/include/utils/array.h') diff --git a/src/include/utils/array.h b/src/include/utils/array.h index f37a8e117e7..1c0f1090214 100644 --- a/src/include/utils/array.h +++ b/src/include/utils/array.h @@ -10,7 +10,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: array.h,v 1.45 2003/08/08 21:42:55 momjian Exp $ + * $Id: array.h,v 1.45.4.1 2005/03/24 21:51:04 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -64,6 +64,15 @@ typedef struct ArrayMetaState FmgrInfo proc; } ArrayMetaState; +/* + * private state needed by array_map (here because caller must provide it) + */ +typedef struct ArrayMapState +{ + ArrayMetaState inp_extra; + ArrayMetaState ret_extra; +} ArrayMapState; + /* * fmgr macros for array objects */ @@ -146,7 +155,8 @@ extern ArrayType *array_set_slice(ArrayType *array, int nSubscripts, int arraylen, int elmlen, bool elmbyval, char elmalign, bool *isNull); -extern Datum array_map(FunctionCallInfo fcinfo, Oid inpType, Oid retType); +extern Datum array_map(FunctionCallInfo fcinfo, Oid inpType, Oid retType, + ArrayMapState *amstate); extern ArrayType *construct_array(Datum *elems, int nelems, Oid elmtype, -- cgit v1.2.3