From 2e9ab30ba98e44b0b13a7bece9eabeab5aa85f6b Mon Sep 17 00:00:00 2001 From: "changying.yue" Date: Wed, 12 Apr 2023 09:53:43 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=A7=E8=A1=8Cpython?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gausskernel/process/postmaster/fencedudf.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gausskernel/process/postmaster/fencedudf.cpp b/src/gausskernel/process/postmaster/fencedudf.cpp index 0206130f4..ec03bd9b4 100644 --- a/src/gausskernel/process/postmaster/fencedudf.cpp +++ b/src/gausskernel/process/postmaster/fencedudf.cpp @@ -1765,17 +1765,17 @@ static void FindOrInsertUDFHashTab(FunctionCallInfoData* fcinfo) } else { char pathbuf[MAXPGPATH]; get_lib_path(my_exec_path, pathbuf); + + join_path_components(pathbuf, pathbuf, "postgresql"); #ifdef ENABLE_PYTHON3 join_path_components(pathbuf, pathbuf, "plpython3.so"); #else join_path_components(pathbuf, pathbuf, "plpython2.so"); #endif - char *libpl_location = strdup(pathbuf); - void *libpl_handler = internal_load_library(libpl_location); + void *libpl_handler = internal_load_library(pathbuf); if (NULL == libpl_handler) ereport(ERROR, (errmodule(MOD_UDF), errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED), - errmsg("internal_load_library %s failed: %m", libpl_location))); - free(libpl_location); + errmsg("internal_load_library %s failed: %m", pathbuf))); Datum (*plpython_call_handler)(FunctionCallInfoData *); #ifdef ENABLE_PYTHON2 plpython_call_handler = (Datum(*)(FunctionCallInfoData *))pg_dlsym(libpl_handler, "plpython_call_handler");