mirror of
https://github.com/MariaDB/server.git
synced 2025-08-09 22:24:09 +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:
@@ -170,8 +170,8 @@
|
|||||||
#define SZWMIN 4194304 // Minimum work area size 4M
|
#define SZWMIN 4194304 // Minimum work area size 4M
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
char version[]= "Version 1.03.0003 August 22, 2014";
|
char version[]= "Version 1.03.0004 October 13, 2014";
|
||||||
char compver[]= "Version 1.03.0003 " __DATE__ " " __TIME__;
|
char compver[]= "Version 1.03.0004 " __DATE__ " " __TIME__;
|
||||||
|
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
char slash= '\\';
|
char slash= '\\';
|
||||||
@@ -451,6 +451,24 @@ static int connect_init_func(void *p)
|
|||||||
{
|
{
|
||||||
DBUG_ENTER("connect_init_func");
|
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);
|
sql_print_information("CONNECT: %s", compver);
|
||||||
|
|
||||||
// xtrace is now a system variable
|
// xtrace is now a system variable
|
||||||
|
@@ -52,6 +52,10 @@
|
|||||||
extern "C" int trace;
|
extern "C" int trace;
|
||||||
extern "C" USETEMP Use_Temp;
|
extern "C" USETEMP Use_Temp;
|
||||||
|
|
||||||
|
#if !defined(WIN32)
|
||||||
|
extern handlerton *connect_hton;
|
||||||
|
#endif // !WIN32
|
||||||
|
|
||||||
/* --------------------------- Class RELDEF -------------------------- */
|
/* --------------------------- Class RELDEF -------------------------- */
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
@@ -455,6 +459,22 @@ PTABDEF OEMDEF::GetXdef(PGLOBAL g)
|
|||||||
} // endif getdef
|
} // endif getdef
|
||||||
#else // !WIN32
|
#else // !WIN32
|
||||||
const char *error = NULL;
|
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?
|
// Is the library already loaded?
|
||||||
// if (!Hdll && !(Hdll = ???))
|
// if (!Hdll && !(Hdll = ???))
|
||||||
// Load the desired shared library
|
// Load the desired shared library
|
||||||
|
Reference in New Issue
Block a user