mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
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.
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/utils/array.h,v 1.52 2005/02/28 03:45:23 neilc Exp $
|
||||
* $PostgreSQL: pgsql/src/include/utils/array.h,v 1.53 2005/03/24 21:50:38 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
|
||||
*/
|
||||
@ -149,7 +158,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,
|
||||
|
Reference in New Issue
Block a user