!1835 添加execInitExprHook

Merge pull request !1835 from 仲夏十三/dolphin
This commit is contained in:
opengauss-bot
2022-06-20 07:36:55 +00:00
committed by Gitee
3 changed files with 7 additions and 0 deletions

View File

@ -5184,6 +5184,11 @@ Datum ExecEvalExprSwitchContext(ExprState* expression, ExprContext* econtext, bo
*/
ExprState* ExecInitExpr(Expr* node, PlanState* parent)
{
if (u_sess->hook_cxt.execInitExprHook != NULL) {
ExprState* expr = ((execInitExprFunc)(u_sess->hook_cxt.execInitExprHook))(node, parent);
if (expr != NULL)
return expr;
}
ExprState* state = NULL;
gstrace_entry(GS_TRC_ID_ExecInitExpr);

View File

@ -152,6 +152,7 @@ extern THR_LOCAL PGDLLIMPORT ExecutorEnd_hook_type ExecutorEnd_hook;
typedef bool (*ExecutorCheckPerms_hook_type)(List*, bool);
extern THR_LOCAL PGDLLIMPORT ExecutorCheckPerms_hook_type ExecutorCheckPerms_hook;
typedef ExprState* (*execInitExprFunc)(Expr* node, PlanState* parent);
/*
* prototypes from functions in execAmi.c
*/

View File

@ -2637,6 +2637,7 @@ typedef struct knl_u_clientConnTime_context {
typedef struct knl_u_hook_context {
void *analyzerRoutineHook;
void *transformStmtHook;
void *execInitExprHook;
} knl_u_hook_context;
typedef struct knl_session_context {