greenplumn hook_test 源码
greenplumn hook_test 代码
文件路径:/src/test/regress/hooktest/hook_test.c
#include "postgres.h"
#include "fmgr.h"
#include "optimizer/planner.h"
PG_MODULE_MAGIC;
static planner_hook_type prev_planner_hook = NULL;
static PlannedStmt *test_planner_hook(Query *parse, int cursorOptions, ParamListInfo boundParams);
void _PG_init(void);
void _PG_fini(void);
void
_PG_init(void)
{
prev_planner_hook = planner_hook;
planner_hook = test_planner_hook;
}
void
_PG_fini(void)
{
planner_hook = prev_planner_hook;
}
static PlannedStmt *
test_planner_hook(Query *parse, int cursorOptions, ParamListInfo boundParams)
{
PlannedStmt *stmt;
elog(LOG, "In test_planner_hook");
if (prev_planner_hook)
stmt = (*prev_planner_hook) (parse, cursorOptions, boundParams);
else
stmt = standard_planner(parse, cursorOptions, boundParams);
return stmt;
}
相关信息
相关文章
0
赞
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦