Commit 0a913e20 authored by Olivier Bertrand's avatar Olivier Bertrand

- Add Sergei fix to enable loading OEM table libs

modified:
  storage/connect/ha_connect.cc
  storage/connect/reldef.cpp
parent b10fa87b
......@@ -170,8 +170,8 @@
#define SZWMIN 4194304 // Minimum work area size 4M
extern "C" {
char version[]= "Version 1.03.0003 August 22, 2014";
char compver[]= "Version 1.03.0003 " __DATE__ " " __TIME__;
char version[]= "Version 1.03.0004 October 13, 2014";
char compver[]= "Version 1.03.0004 " __DATE__ " " __TIME__;
#if defined(WIN32)
char slash= '\\';
......@@ -451,6 +451,24 @@ static int connect_init_func(void *p)
{
DBUG_ENTER("connect_init_func");
// added from Sergei mail
#if 0 // (defined(LINUX))
Dl_info dl_info;
if (dladdr(&connect_hton, &dl_info))
{
if (dlopen(dl_info.dli_fname, RTLD_NOLOAD | RTLD_NOW | RTLD_GLOBAL) == 0)
{
sql_print_information("CONNECT: dlopen() failed, OEM table type is not supported");
sql_print_information("CONNECT: %s", dlerror());
}
}
else
{
sql_print_information("CONNECT: dladdr() failed, OEM table type is not supported");
sql_print_information("CONNECT: %s", dlerror());
}
#endif // 0 (LINUX)
sql_print_information("CONNECT: %s", compver);
// xtrace is now a system variable
......
......@@ -52,6 +52,10 @@
extern "C" int trace;
extern "C" USETEMP Use_Temp;
#if !defined(WIN32)
extern handlerton *connect_hton;
#endif // !WIN32
/* --------------------------- Class RELDEF -------------------------- */
/***********************************************************************/
......@@ -455,6 +459,22 @@ PTABDEF OEMDEF::GetXdef(PGLOBAL g)
} // endif getdef
#else // !WIN32
const char *error = NULL;
Dl_info dl_info;
// The OEM lib must retrieve exported CONNECT variables
if (dladdr(&connect_hton, &dl_info)) {
if (dlopen(dl_info.dli_fname, RTLD_NOLOAD | RTLD_NOW | RTLD_GLOBAL) == 0) {
error = dlerror();
sprintf(g->Message, "dlopen failed: %s, OEM not supported", SVP(error));
return NULL;
} // endif dlopen
} else {
error = dlerror();
sprintf(g->Message, "dladdr failed: %s, OEM not supported", SVP(error));
return NULL;
} // endif dladdr
// Is the library already loaded?
// if (!Hdll && !(Hdll = ???))
// Load the desired shared library
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment