summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Bertrand <bertrandop@gmail.com>2014-10-14 16:42:22 +0200
committerOlivier Bertrand <bertrandop@gmail.com>2014-10-14 16:42:22 +0200
commit0a913e20d2b937d888b6fd829f4ff9c2b54f0c20 (patch)
treee631c34a9ae711a1b6b220e5dfecbb70115e3989
parentb10fa87b15b504ed1467558cf8984ed8de0c6184 (diff)
downloadmariadb-git-0a913e20d2b937d888b6fd829f4ff9c2b54f0c20.tar.gz
- Add Sergei fix to enable loading OEM table libs
modified: storage/connect/ha_connect.cc storage/connect/reldef.cpp
-rw-r--r--storage/connect/ha_connect.cc22
-rw-r--r--storage/connect/reldef.cpp20
2 files changed, 40 insertions, 2 deletions
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index f6f7fac8a76..697b29ff72c 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -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
diff --git a/storage/connect/reldef.cpp b/storage/connect/reldef.cpp
index 22076b78086..8d5f96dce95 100644
--- a/storage/connect/reldef.cpp
+++ b/storage/connect/reldef.cpp
@@ -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