deep copy procedure arg value
Offering: openGaussDev More detail: deep copy procedure arg value Match-id-dda612d112a2a69b554912340314383a39e71a7c
This commit is contained in:
@ -126,6 +126,7 @@ static void advance_windowaggregate(
|
||||
ExprState* arg_state = (ExprState*)lfirst(arg);
|
||||
|
||||
fcinfo->arg[i] = ExecEvalExpr(arg_state, econtext, &fcinfo->argnull[i], NULL);
|
||||
fcinfo->argTypes[i] = arg_state->resultType;
|
||||
i++;
|
||||
}
|
||||
|
||||
@ -176,6 +177,7 @@ static void advance_windowaggregate(
|
||||
*fcinfo, &(peraggstate->transfn), num_arguments + 1, perfuncstate->winCollation, (Node*)winstate, NULL);
|
||||
fcinfo->arg[0] = peraggstate->transValue;
|
||||
fcinfo->argnull[0] = peraggstate->transValueIsNull;
|
||||
fcinfo->argTypes[0] = InvalidOid;
|
||||
new_val = FunctionCallInvoke(fcinfo);
|
||||
/*
|
||||
* If pass-by-ref datatype, must copy the new value into aggcontext and
|
||||
@ -216,6 +218,7 @@ static void finalize_windowaggregate(WindowAggState* winstate, WindowStatePerFun
|
||||
InitFunctionCallInfoData(fcinfo, &(peraggstate->finalfn), 1, perfuncstate->winCollation, (Node*)winstate, NULL);
|
||||
fcinfo.arg[0] = peraggstate->transValue;
|
||||
fcinfo.argnull[0] = peraggstate->transValueIsNull;
|
||||
fcinfo.argTypes[0] = InvalidOid;
|
||||
if (fcinfo.flinfo->fn_strict && peraggstate->transValueIsNull) {
|
||||
/* don't call a strict function with NULL inputs */
|
||||
*result = (Datum)0;
|
||||
|
||||
Reference in New Issue
Block a user