mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-12 18:34:36 +08:00
Track procedure calls in pg_stat_user_functions
This was forgotten when procedures were implemented. Reported-by: Lukas Fittl <lukas@fittl.com>
This commit is contained in:
parent
9c2a970d1f
commit
634b4b79cb
@ -60,6 +60,7 @@
|
|||||||
#include "parser/parse_expr.h"
|
#include "parser/parse_expr.h"
|
||||||
#include "parser/parse_func.h"
|
#include "parser/parse_func.h"
|
||||||
#include "parser/parse_type.h"
|
#include "parser/parse_type.h"
|
||||||
|
#include "pgstat.h"
|
||||||
#include "utils/acl.h"
|
#include "utils/acl.h"
|
||||||
#include "utils/builtins.h"
|
#include "utils/builtins.h"
|
||||||
#include "utils/fmgroids.h"
|
#include "utils/fmgroids.h"
|
||||||
@ -2219,6 +2220,7 @@ ExecuteCallStmt(CallStmt *stmt, ParamListInfo params, bool atomic, DestReceiver
|
|||||||
EState *estate;
|
EState *estate;
|
||||||
ExprContext *econtext;
|
ExprContext *econtext;
|
||||||
HeapTuple tp;
|
HeapTuple tp;
|
||||||
|
PgStat_FunctionCallUsage fcusage;
|
||||||
Datum retval;
|
Datum retval;
|
||||||
|
|
||||||
fexpr = stmt->funcexpr;
|
fexpr = stmt->funcexpr;
|
||||||
@ -2302,7 +2304,9 @@ ExecuteCallStmt(CallStmt *stmt, ParamListInfo params, bool atomic, DestReceiver
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pgstat_init_function_usage(&fcinfo, &fcusage);
|
||||||
retval = FunctionCallInvoke(&fcinfo);
|
retval = FunctionCallInvoke(&fcinfo);
|
||||||
|
pgstat_end_function_usage(&fcusage, true);
|
||||||
|
|
||||||
if (fexpr->funcresulttype == VOIDOID)
|
if (fexpr->funcresulttype == VOIDOID)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user