@@ -685,50 +685,17 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull)
685685
686686 EEO_CASE (EEOP_FUNCEXPR_FUSAGE )
687687 {
688- FunctionCallInfo fcinfo = op -> d .func .fcinfo_data ;
689- PgStat_FunctionCallUsage fcusage ;
690- Datum d ;
691-
692- pgstat_init_function_usage (fcinfo , & fcusage );
693-
694- fcinfo -> isnull = false;
695- d = op -> d .func .fn_addr (fcinfo );
696- * op -> resvalue = d ;
697- * op -> resnull = fcinfo -> isnull ;
698-
699- pgstat_end_function_usage (& fcusage , true);
688+ /* not common enough to inline */
689+ ExecEvalFuncExprFusage (state , op , econtext );
700690
701691 EEO_NEXT ();
702692 }
703693
704694 EEO_CASE (EEOP_FUNCEXPR_STRICT_FUSAGE )
705695 {
706- FunctionCallInfo fcinfo = op -> d .func .fcinfo_data ;
707- PgStat_FunctionCallUsage fcusage ;
708- bool * argnull = fcinfo -> argnull ;
709- int argno ;
710- Datum d ;
696+ /* not common enough to inline */
697+ ExecEvalFuncExprStrictFusage (state , op , econtext );
711698
712- /* strict function, so check for NULL args */
713- for (argno = 0 ; argno < op -> d .func .nargs ; argno ++ )
714- {
715- if (argnull [argno ])
716- {
717- * op -> resnull = true;
718- goto strictfail_fusage ;
719- }
720- }
721-
722- pgstat_init_function_usage (fcinfo , & fcusage );
723-
724- fcinfo -> isnull = false;
725- d = op -> d .func .fn_addr (fcinfo );
726- * op -> resvalue = d ;
727- * op -> resnull = fcinfo -> isnull ;
728-
729- pgstat_end_function_usage (& fcusage , true);
730-
731- strictfail_fusage :
732699 EEO_NEXT ();
733700 }
734701
@@ -2207,6 +2174,61 @@ ExecEvalStepOp(ExprState *state, ExprEvalStep *op)
22072174 * Out-of-line helper functions for complex instructions.
22082175 */
22092176
2177+ /*
2178+ * Evaluate EEOP_FUNCEXPR_FUSAGE
2179+ */
2180+ void
2181+ ExecEvalFuncExprFusage (ExprState * state , ExprEvalStep * op ,
2182+ ExprContext * econtext )
2183+ {
2184+ FunctionCallInfo fcinfo = op -> d .func .fcinfo_data ;
2185+ PgStat_FunctionCallUsage fcusage ;
2186+ Datum d ;
2187+
2188+ pgstat_init_function_usage (fcinfo , & fcusage );
2189+
2190+ fcinfo -> isnull = false;
2191+ d = op -> d .func .fn_addr (fcinfo );
2192+ * op -> resvalue = d ;
2193+ * op -> resnull = fcinfo -> isnull ;
2194+
2195+ pgstat_end_function_usage (& fcusage , true);
2196+ }
2197+
2198+ /*
2199+ * Evaluate EEOP_FUNCEXPR_STRICT_FUSAGE
2200+ */
2201+ void
2202+ ExecEvalFuncExprStrictFusage (ExprState * state , ExprEvalStep * op ,
2203+ ExprContext * econtext )
2204+ {
2205+
2206+ FunctionCallInfo fcinfo = op -> d .func .fcinfo_data ;
2207+ PgStat_FunctionCallUsage fcusage ;
2208+ bool * argnull = fcinfo -> argnull ;
2209+ int argno ;
2210+ Datum d ;
2211+
2212+ /* strict function, so check for NULL args */
2213+ for (argno = 0 ; argno < op -> d .func .nargs ; argno ++ )
2214+ {
2215+ if (argnull [argno ])
2216+ {
2217+ * op -> resnull = true;
2218+ return ;
2219+ }
2220+ }
2221+
2222+ pgstat_init_function_usage (fcinfo , & fcusage );
2223+
2224+ fcinfo -> isnull = false;
2225+ d = op -> d .func .fn_addr (fcinfo );
2226+ * op -> resvalue = d ;
2227+ * op -> resnull = fcinfo -> isnull ;
2228+
2229+ pgstat_end_function_usage (& fcusage , true);
2230+ }
2231+
22102232/*
22112233 * Evaluate a PARAM_EXEC parameter.
22122234 *
0 commit comments