
Go to the source code of this file.
Data Structures | |
| struct | ParamExternData |
| struct | ParamListInfoData |
| struct | ParamExecData |
Defines | |
| #define | PARAM_FLAG_CONST 0x0001 |
Typedefs | |
| typedef struct ParamExternData | ParamExternData |
| typedef struct ParamListInfoData * | ParamListInfo |
| typedef void(* | ParamFetchHook )(ParamListInfo params, int paramid) |
| typedef void(* | ParserSetupHook )(struct ParseState *pstate, void *arg) |
| typedef struct ParamListInfoData | ParamListInfoData |
| typedef struct ParamExecData | ParamExecData |
Functions | |
| ParamListInfo | copyParamList (ParamListInfo from) |
| #define PARAM_FLAG_CONST 0x0001 |
Definition at line 51 of file params.h.
Referenced by eval_const_expressions_mutator().
| typedef struct ParamExecData ParamExecData |
| typedef struct ParamExternData ParamExternData |
| typedef void(* ParamFetchHook)(ParamListInfo params, int paramid) |
| typedef struct ParamListInfoData* ParamListInfo |
| typedef struct ParamListInfoData ParamListInfoData |
| typedef void(* ParserSetupHook)(struct ParseState *pstate, void *arg) |
| ParamListInfo copyParamList | ( | ParamListInfo | from | ) |
Definition at line 34 of file params.c.
References datumCopy(), get_typlenbyval(), i, ParamExternData::isnull, NULL, ParamListInfoData::numParams, OidIsValid, palloc(), ParamListInfoData::paramFetch, ParamListInfoData::paramFetchArg, ParamListInfoData::params, ParamListInfoData::parserSetup, ParamListInfoData::parserSetupArg, ParamExternData::ptype, and ParamExternData::value.
Referenced by PerformCursorOpen(), and SPI_cursor_open_internal().
{
ParamListInfo retval;
Size size;
int i;
if (from == NULL || from->numParams <= 0)
return NULL;
/* sizeof(ParamListInfoData) includes the first array element */
size = sizeof(ParamListInfoData) +
(from->numParams - 1) * sizeof(ParamExternData);
retval = (ParamListInfo) palloc(size);
retval->paramFetch = NULL;
retval->paramFetchArg = NULL;
retval->parserSetup = NULL;
retval->parserSetupArg = NULL;
retval->numParams = from->numParams;
for (i = 0; i < from->numParams; i++)
{
ParamExternData *oprm = &from->params[i];
ParamExternData *nprm = &retval->params[i];
int16 typLen;
bool typByVal;
/* give hook a chance in case parameter is dynamic */
if (!OidIsValid(oprm->ptype) && from->paramFetch != NULL)
(*from->paramFetch) (from, i + 1);
/* flat-copy the parameter info */
*nprm = *oprm;
/* need datumCopy in case it's a pass-by-reference datatype */
if (nprm->isnull || !OidIsValid(nprm->ptype))
continue;
get_typlenbyval(nprm->ptype, &typLen, &typByVal);
nprm->value = datumCopy(nprm->value, typByVal, typLen);
}
return retval;
}
1.7.1