@@ -685,50 +685,17 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull)
685
685
686
686
EEO_CASE (EEOP_FUNCEXPR_FUSAGE )
687
687
{
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 );
700
690
701
691
EEO_NEXT ();
702
692
}
703
693
704
694
EEO_CASE (EEOP_FUNCEXPR_STRICT_FUSAGE )
705
695
{
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 );
711
698
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 :
732
699
EEO_NEXT ();
733
700
}
734
701
@@ -2207,6 +2174,61 @@ ExecEvalStepOp(ExprState *state, ExprEvalStep *op)
2207
2174
* Out-of-line helper functions for complex instructions.
2208
2175
*/
2209
2176
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
+
2210
2232
/*
2211
2233
* Evaluate a PARAM_EXEC parameter.
2212
2234
*
0 commit comments