1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

- Add Sergei fix to enable loading OEM table libs

modified:
  storage/connect/ha_connect.cc
  storage/connect/reldef.cpp
This commit is contained in:
Olivier Bertrand
2014-10-14 16:42:22 +02:00
parent b10fa87b15
commit 0a913e20d2
2 changed files with 40 additions and 2 deletions

View File

@@ -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