summaryrefslogtreecommitdiff
path: root/storage/connect/ha_connect.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/connect/ha_connect.cc')
-rw-r--r--storage/connect/ha_connect.cc67
1 files changed, 58 insertions, 9 deletions
diff --git a/storage/connect/ha_connect.cc b/storage/connect/ha_connect.cc
index 4aef3af9946..eaebd88b0cd 100644
--- a/storage/connect/ha_connect.cc
+++ b/storage/connect/ha_connect.cc
@@ -119,6 +119,7 @@
#undef OFFSET
#define NOPARSE
+#define NJDBC
#if defined(UNIX)
#include "osutil.h"
#endif // UNIX
@@ -169,7 +170,7 @@
#define JSONMAX 10 // JSON Default max grp size
extern "C" {
- char version[]= "Version 1.04.0006 March 12, 2016";
+ char version[]= "Version 1.04.0006 May 08, 2016";
#if defined(__WIN__)
char compver[]= "Version 1.04.0006 " __DATE__ " " __TIME__;
char slash= '\\';
@@ -190,6 +191,18 @@ extern "C" {
} // extern "C"
#endif // XMSG
+#if defined(JDBC_SUPPORT)
+ char *JvmPath;
+ char *ClassPath;
+ char *Wrapper;
+#endif // JDBC_SUPPORT
+
+#if defined(__WIN__)
+CRITICAL_SECTION parsec; // Used calling the Flex parser
+#else // !__WIN__
+pthread_mutex_t parmut = PTHREAD_MUTEX_INITIALIZER;
+#endif // !__WIN__
+
/***********************************************************************/
/* Utility functions. */
/***********************************************************************/
@@ -634,6 +647,7 @@ static int connect_init_func(void *p)
#if defined(__WIN__)
sql_print_information("CONNECT: %s", compver);
+ InitializeCriticalSection((LPCRITICAL_SECTION)&parsec);
#else // !__WIN__
sql_print_information("CONNECT: %s", version);
#endif // !__WIN__
@@ -660,6 +674,9 @@ static int connect_init_func(void *p)
DTVAL::SetTimeShift(); // Initialize time zone shift once for all
BINCOL::SetEndian(); // Initialize host endian setting
+#if defined(JDBC_SUPPORT)
+ JDBConn::SetJVM();
+#endif // JDBC_SUPPORT
DBUG_RETURN(0);
} // end of connect_init_func
@@ -676,11 +693,17 @@ static int connect_done_func(void *)
#ifdef LIBXML2_SUPPORT
XmlCleanupParserLib();
-#endif // LIBXML2_SUPPORT
+#endif // LIBXML2_SUPPORT
-#if !defined(__WIN__)
-//PROFILE_End(); Causes signal 11
-#endif // !__WIN__
+#ifdef JDBC_SUPPORT
+ JDBConn::ResetJVM();
+#endif // JDBC_SUPPORT
+
+#if defined(__WIN__)
+ DeleteCriticalSection((LPCRITICAL_SECTION)&parsec);
+#else // !__WIN__
+ PROFILE_End();
+#endif // !__WIN__
for (pc= user_connect::to_users; pc; pc= pn) {
if (pc->g)
@@ -1937,7 +1960,7 @@ int ha_connect::MakeRecord(char *buf)
if (trace > 1)
htrc("Maps: read=%08X write=%08X vcol=%08X defr=%08X defw=%08X\n",
*table->read_set->bitmap, *table->write_set->bitmap,
- *table->vcol_set->bitmap,
+ (table->vcol_set) ? *table->vcol_set->bitmap : 0,
*table->def_read_set.bitmap, *table->def_write_set.bitmap);
// Avoid asserts in field::store() for columns that are not updated
@@ -5177,7 +5200,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
spc= (!sep) ? ',' : *sep;
qch= topt->qchar ? *topt->qchar : (signed)topt->quoted >= 0 ? '"' : 0;
hdr= (int)topt->header;
- tbl= topt->tablist;
+ tbl= topt->tablist;
col= topt->colist;
if (topt->oplist) {
@@ -5585,7 +5608,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
len= crp->Length;
dec= crp->Prec;
flg= crp->Flag;
- v= crp->Var;
+ v= (crp->Kdata->IsUnsigned()) ? 'U' : crp->Var;
tm= (crp->Kdata->IsNullable()) ? 0 : NOT_NULL_FLAG;
if (!len && typ == TYPE_STRING)
@@ -6831,6 +6854,27 @@ static MYSQL_SYSVAR_STR(errmsg_dir_path, msg_path,
"../../../../storage/connect/"); // for testing
#endif // XMSG
+#if defined(JDBC_SUPPORT)
+static MYSQL_SYSVAR_STR(jvm_path, JvmPath,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC,
+ "Path to the directory where is the JVM lib",
+ // check_jvm_path, update_jvm_path,
+ NULL, NULL, NULL);
+
+static MYSQL_SYSVAR_STR(class_path, ClassPath,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC,
+ "Java class path",
+ // check_class_path, update_class_path,
+ NULL, NULL, NULL);
+
+static MYSQL_SYSVAR_STR(java_wrapper, Wrapper,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC,
+ "Java wrapper class",
+ // check_class_path, update_class_path,
+ NULL, NULL, "JdbcInterface");
+#endif // JDBC_SUPPORT
+
+
static struct st_mysql_sys_var* connect_system_variables[]= {
MYSQL_SYSVAR(xtrace),
MYSQL_SYSVAR(conv_size),
@@ -6848,7 +6892,12 @@ static struct st_mysql_sys_var* connect_system_variables[]= {
MYSQL_SYSVAR(errmsg_dir_path),
#endif // XMSG
MYSQL_SYSVAR(json_grp_size),
- NULL
+#if defined(JDBC_SUPPORT)
+ MYSQL_SYSVAR(jvm_path),
+ MYSQL_SYSVAR(class_path),
+ MYSQL_SYSVAR(java_wrapper),
+#endif // JDBC_SUPPORT
+ NULL
};
maria_declare_plugin(connect)