diff --git a/GNUmakefile.in b/GNUmakefile.in index 9a5919e38..b5b099d37 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -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 diff --git a/build/script/aarch64_opengauss_list b/build/script/aarch64_opengauss_list index 2904c867a..06d078ea2 100644 --- a/build/script/aarch64_opengauss_list +++ b/build/script/aarch64_opengauss_list @@ -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 diff --git a/build/script/opengauss_release_list_ubuntu_single b/build/script/opengauss_release_list_ubuntu_single index dfd0958b4..4f3b8da5e 100644 --- a/build/script/opengauss_release_list_ubuntu_single +++ b/build/script/opengauss_release_list_ubuntu_single @@ -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 diff --git a/build/script/x86_64_opengauss_list b/build/script/x86_64_opengauss_list index 4f1eee380..6bc6510f1 100644 --- a/build/script/x86_64_opengauss_list +++ b/build/script/x86_64_opengauss_list @@ -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 diff --git a/src/common/backend/utils/fmgr/fmgr.cpp b/src/common/backend/utils/fmgr/fmgr.cpp index bd3538496..de6e9e2ce 100755 --- a/src/common/backend/utils/fmgr/fmgr.cpp +++ b/src/common/backend/utils/fmgr/fmgr.cpp @@ -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, diff --git a/src/gausskernel/runtime/vecexecutor/vecexpression.cpp b/src/gausskernel/runtime/vecexecutor/vecexpression.cpp index 46fe14c89..624bf272c 100644 --- a/src/gausskernel/runtime/vecexecutor/vecexpression.cpp +++ b/src/gausskernel/runtime/vecexecutor/vecexpression.cpp @@ -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; diff --git a/src/include/knl/knl_instance.h b/src/include/knl/knl_instance.h index 1853d7035..b5ae35361 100755 --- a/src/include/knl/knl_instance.h +++ b/src/include/knl/knl_instance.h @@ -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.