whale插件适配

This commit is contained in:
luozihao
2023-08-29 19:26:55 +08:00
parent 4d1cfb2d2a
commit da42d9432a
7 changed files with 26 additions and 0 deletions

View File

@ -96,6 +96,7 @@ install:
$(MAKE) -C contrib/dblink $@
$(MAKE) -C contrib/ndpplugin $@
@if test -d contrib/dolphin; then $(MAKE) -C contrib/dolphin $@; fi
@if test -d contrib/whale; then $(MAKE) -C contrib/whale $@; fi
+@echo "openGauss installation complete."
endif
endif

View File

@ -79,6 +79,8 @@
./share/postgresql/extension/dolphin--2.0--2.0.1.sql
./share/postgresql/extension/dolphin--1.1--2.0.sql
./share/postgresql/extension/dolphin--2.0--1.1.sql
./share/postgresql/extension/whale.control
./share/postgresql/extension/whale--1.0.sql
./share/postgresql/extension/dolphin--2.0.1--2.0.sql
./share/postgresql/extension/openGauss_expr_dolphin.ir
./share/postgresql/extension/assessment--1.0.sql
@ -773,6 +775,7 @@
./lib/postgresql/proc_srclib
./lib/postgresql/security_plugin.so
./lib/postgresql/dolphin.so
./lib/postgresql/whale.so
./lib/postgresql/pg_upgrade_support.so
./lib/postgresql/java/pljava.jar
./lib/postgresql/postgres_fdw.so

View File

@ -67,6 +67,8 @@
./share/postgresql/extension/dolphin--2.0--1.0.sql
./share/postgresql/extension/dolphin--1.1--2.0.sql
./share/postgresql/extension/dolphin--2.0--1.1.sql
./share/postgresql/extension/whale.control
./share/postgresql/extension/whale--1.0.sql
./share/postgresql/extension/openGauss_expr_dolphin.ir
./share/postgresql/extension/file_fdw--1.0.sql
./share/postgresql/extension/plpgsql.control
@ -761,6 +763,7 @@
./lib/postgresql/proc_srclib
./lib/postgresql/security_plugin.so
./lib/postgresql/dolphin.so
./lib/postgresql/whale.so
./lib/postgresql/pg_upgrade_support.so
./lib/postgresql/java/pljava.jar
./lib/postgresql/postgres_fdw.so

View File

@ -79,6 +79,8 @@
./share/postgresql/extension/dolphin--2.0--2.0.1.sql
./share/postgresql/extension/dolphin--1.1--2.0.sql
./share/postgresql/extension/dolphin--2.0--1.1.sql
./share/postgresql/extension/whale.control
./share/postgresql/extension/whale--1.0.sql
./share/postgresql/extension/dolphin--2.0.1--2.0.sql
./share/postgresql/extension/openGauss_expr_dolphin.ir
./share/postgresql/extension/assessment--1.0.sql
@ -773,6 +775,7 @@
./lib/postgresql/proc_srclib
./lib/postgresql/security_plugin.so
./lib/postgresql/dolphin.so
./lib/postgresql/whale.so
./lib/postgresql/pg_upgrade_support.so
./lib/postgresql/java/pljava.jar
./lib/postgresql/postgres_fdw.so

View File

@ -157,6 +157,12 @@ static RegExternFunc plpgsql_function_table[] = {
*/
RegExternFunc b_plpgsql_function_table[3];
/*
* Now for whale to rewrite plpgsql_call_handler, plpgsql_inline_handler
* and plpgsql_validator.
*/
RegExternFunc a_plpgsql_function_table[3];
static HTAB* CFuncHash = NULL;
static void fmgr_info_cxt_security(Oid functionId, FmgrInfo* finfo, MemoryContext mcxt, bool ignore_security);
@ -403,6 +409,12 @@ static PGFunction load_plpgsql_function(char* funcname)
sizeof(b_plpgsql_function_table) / sizeof(b_plpgsql_function_table[0]),
sizeof(RegExternFunc),
ExternFuncComp);
} else if (u_sess->attr.attr_sql.whale) {
search_result = (RegExternFunc*)bsearch(&tmp_key,
a_plpgsql_function_table,
sizeof(a_plpgsql_function_table) / sizeof(a_plpgsql_function_table[0]),
sizeof(RegExternFunc),
ExternFuncComp);
}
if (search_result == NULL) {
search_result = (RegExternFunc*)bsearch(&tmp_key,

View File

@ -1996,6 +1996,9 @@ void InitVectorFunction(FunctionCallInfo finfo, MemoryContext fcacheCxt)
if (u_sess->attr.attr_sql.dolphin &&
g_instance.plugin_vec_func_cxt.vec_func_plugin[DOLPHIN_VEC] != NULL) {
vec_func_hash = g_instance.plugin_vec_func_cxt.vec_func_plugin[DOLPHIN_VEC];
} else if (u_sess->attr.attr_sql.whale &&
g_instance.plugin_vec_func_cxt.vec_func_plugin[WHALE_VEC] != NULL) {
vec_func_hash = g_instance.plugin_vec_func_cxt.vec_func_plugin[WHALE_VEC];
} else
#endif
vec_func_hash = g_instance.vec_func_hash;

View File

@ -149,6 +149,7 @@ typedef struct knl_g_cost_context {
enum plugin_vecfunc_type {
DOLPHIN_VEC = 0,
WHALE_VEC,
/*
* This is the number of vecfunc hash tables.