* Evaluate EEOP_FUNCEXPR_STRICT_FUSAGE */
| 2448 | * Evaluate EEOP_FUNCEXPR_STRICT_FUSAGE |
| 2449 | */ |
| 2450 | void |
| 2451 | ExecEvalFuncExprStrictFusage(ExprState *state, ExprEvalStep *op, |
| 2452 | ExprContext *econtext) |
| 2453 | { |
| 2454 | |
| 2455 | FunctionCallInfo fcinfo = op->d.func.fcinfo_data; |
| 2456 | PgStat_FunctionCallUsage fcusage; |
| 2457 | NullableDatum *args = fcinfo->args; |
| 2458 | int nargs = op->d.func.nargs; |
| 2459 | Datum d; |
| 2460 | |
| 2461 | /* strict function, so check for NULL args */ |
| 2462 | for (int argno = 0; argno < nargs; argno++) |
| 2463 | { |
| 2464 | if (args[argno].isnull) |
| 2465 | { |
| 2466 | *op->resnull = true; |
| 2467 | return; |
| 2468 | } |
| 2469 | } |
| 2470 | |
| 2471 | pgstat_init_function_usage(fcinfo, &fcusage); |
| 2472 | |
| 2473 | fcinfo->isnull = false; |
| 2474 | d = op->d.func.fn_addr(fcinfo); |
| 2475 | *op->resvalue = d; |
| 2476 | *op->resnull = fcinfo->isnull; |
| 2477 | |
| 2478 | pgstat_end_function_usage(&fcusage, true); |
| 2479 | } |
| 2480 | |
| 2481 | /* |
| 2482 | * Evaluate a PARAM_EXEC parameter. |
no test coverage detected