diff options
Diffstat (limited to 'src/backend/tcop/fastpath.c')
-rw-r--r-- | src/backend/tcop/fastpath.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/backend/tcop/fastpath.c b/src/backend/tcop/fastpath.c index 4a243b0777a..b6d2e2ac112 100644 --- a/src/backend/tcop/fastpath.c +++ b/src/backend/tcop/fastpath.c @@ -258,9 +258,9 @@ fetch_fp_info(Oid func_id, struct fp_info *fip) void HandleFunctionRequest(StringInfo msgBuf) { + LOCAL_FCINFO(fcinfo, FUNC_MAX_ARGS); Oid fid; AclResult aclresult; - FunctionCallInfoData fcinfo; int16 rformat; Datum retval; struct fp_info my_fp; @@ -332,12 +332,12 @@ HandleFunctionRequest(StringInfo msgBuf) * functions can't be called this way. Perhaps we should pass * DEFAULT_COLLATION_OID, instead? */ - InitFunctionCallInfoData(fcinfo, &fip->flinfo, 0, InvalidOid, NULL, NULL); + InitFunctionCallInfoData(*fcinfo, &fip->flinfo, 0, InvalidOid, NULL, NULL); if (PG_PROTOCOL_MAJOR(FrontendProtocol) >= 3) - rformat = parse_fcall_arguments(msgBuf, fip, &fcinfo); + rformat = parse_fcall_arguments(msgBuf, fip, fcinfo); else - rformat = parse_fcall_arguments_20(msgBuf, fip, &fcinfo); + rformat = parse_fcall_arguments_20(msgBuf, fip, fcinfo); /* Verify we reached the end of the message where expected. */ pq_getmsgend(msgBuf); @@ -350,9 +350,9 @@ HandleFunctionRequest(StringInfo msgBuf) { int i; - for (i = 0; i < fcinfo.nargs; i++) + for (i = 0; i < fcinfo->nargs; i++) { - if (fcinfo.argnull[i]) + if (fcinfo->args[i].isnull) { callit = false; break; @@ -363,18 +363,18 @@ HandleFunctionRequest(StringInfo msgBuf) if (callit) { /* Okay, do it ... */ - retval = FunctionCallInvoke(&fcinfo); + retval = FunctionCallInvoke(fcinfo); } else { - fcinfo.isnull = true; + fcinfo->isnull = true; retval = (Datum) 0; } /* ensure we do at least one CHECK_FOR_INTERRUPTS per function call */ CHECK_FOR_INTERRUPTS(); - SendFunctionResult(retval, fcinfo.isnull, fip->rettype, rformat); + SendFunctionResult(retval, fcinfo->isnull, fip->rettype, rformat); /* We no longer need the snapshot */ PopActiveSnapshot(); @@ -450,11 +450,11 @@ parse_fcall_arguments(StringInfo msgBuf, struct fp_info *fip, argsize = pq_getmsgint(msgBuf, 4); if (argsize == -1) { - fcinfo->argnull[i] = true; + fcinfo->args[i].isnull = true; } else { - fcinfo->argnull[i] = false; + fcinfo->args[i].isnull = false; if (argsize < 0) ereport(ERROR, (errcode(ERRCODE_PROTOCOL_VIOLATION), @@ -494,8 +494,8 @@ parse_fcall_arguments(StringInfo msgBuf, struct fp_info *fip, else pstring = pg_client_to_server(abuf.data, argsize); - fcinfo->arg[i] = OidInputFunctionCall(typinput, pstring, - typioparam, -1); + fcinfo->args[i].value = OidInputFunctionCall(typinput, pstring, + typioparam, -1); /* Free result of encoding conversion, if any */ if (pstring && pstring != abuf.data) pfree(pstring); @@ -514,8 +514,8 @@ parse_fcall_arguments(StringInfo msgBuf, struct fp_info *fip, else bufptr = &abuf; - fcinfo->arg[i] = OidReceiveFunctionCall(typreceive, bufptr, - typioparam, -1); + fcinfo->args[i].value = OidReceiveFunctionCall(typreceive, bufptr, + typioparam, -1); /* Trouble if it didn't eat the whole buffer */ if (argsize != -1 && abuf.cursor != abuf.len) @@ -579,12 +579,12 @@ parse_fcall_arguments_20(StringInfo msgBuf, struct fp_info *fip, argsize = pq_getmsgint(msgBuf, 4); if (argsize == -1) { - fcinfo->argnull[i] = true; - fcinfo->arg[i] = OidReceiveFunctionCall(typreceive, NULL, - typioparam, -1); + fcinfo->args[i].isnull = true; + fcinfo->args[i].value = OidReceiveFunctionCall(typreceive, NULL, + typioparam, -1); continue; } - fcinfo->argnull[i] = false; + fcinfo->args[i].isnull = false; if (argsize < 0) ereport(ERROR, (errcode(ERRCODE_PROTOCOL_VIOLATION), @@ -597,8 +597,8 @@ parse_fcall_arguments_20(StringInfo msgBuf, struct fp_info *fip, pq_getmsgbytes(msgBuf, argsize), argsize); - fcinfo->arg[i] = OidReceiveFunctionCall(typreceive, &abuf, - typioparam, -1); + fcinfo->args[i].value = OidReceiveFunctionCall(typreceive, &abuf, + typioparam, -1); /* Trouble if it didn't eat the whole buffer */ if (abuf.cursor != abuf.len) |