Skip to content

Commit 6aa163b

Browse files
committed
- Continue working on the JDBC table type
Suppress the jpath option add the connect_jvm_path and connect_class_path global variables modified: storage/connect/ha_connect.cc modified: storage/connect/jdbccat.h modified: storage/connect/jdbconn.cpp modified: storage/connect/jdbconn.h modified: storage/connect/tabjdbc.cpp modified: storage/connect/tabjdbc.h - Add the envar UDF modified: storage/connect/jsonudf.cpp modified: storage/connect/jsonudf.h - Fix MDEV-9950 modified: storage/connect/ha_connect.cc modified: storage/connect/plgdbutl.cpp
1 parent 2323cf0 commit 6aa163b

File tree

9 files changed

+207
-141
lines changed

9 files changed

+207
-141
lines changed

storage/connect/ha_connect.cc

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,13 @@ extern "C" {
193193

194194
#if defined(JDBC_SUPPORT)
195195
char *JvmPath;
196+
char *ClassPath;
196197
#endif // JDBC_SUPPORT
197198

198199
#if defined(__WIN__)
199200
CRITICAL_SECTION parsec; // Used calling the Flex parser
200201
#else // !__WIN__
201-
pthread_mutex_t parmut;
202+
pthread_mutex_t parmut = PTHREAD_MUTEX_INITIALIZER;
202203
#endif // !__WIN__
203204

204205
/***********************************************************************/
@@ -5156,7 +5157,6 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
51565157
#endif // ODBC_SUPPORT
51575158
#if defined(JDBC_SUPPORT)
51585159
PJPARM sjp= NULL;
5159-
char *jpath= NULL;
51605160
char *driver= NULL;
51615161
char *url= NULL;
51625162
char *tabtyp = NULL;
@@ -5223,7 +5223,6 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
52235223
cnc= (!*ucnc || *ucnc == 'y' || *ucnc == 'Y' || atoi(ucnc) != 0);
52245224
#endif
52255225
#if defined(JDBC_SUPPORT)
5226-
jpath= GetListOption(g, "Jpath", topt->oplist, NULL);
52275226
driver= GetListOption(g, "Driver", topt->oplist, NULL);
52285227
url= GetListOption(g, "URL", topt->oplist, NULL);
52295228
tabtyp = GetListOption(g, "Tabtype", topt->oplist, NULL);
@@ -5510,23 +5509,22 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
55105509
case FNC_NO:
55115510
case FNC_COL:
55125511
if (src) {
5513-
qrp= JDBCSrcCols(g, jpath, (char*)src, sjp);
5512+
qrp= JDBCSrcCols(g, (char*)src, sjp);
55145513
src= NULL; // for next tests
55155514
} else
5516-
qrp= JDBCColumns(g, jpath, shm, tab, NULL,
5517-
mxr, fnc == FNC_COL, sjp);
5515+
qrp= JDBCColumns(g, shm, tab, NULL, mxr, fnc == FNC_COL, sjp);
55185516

55195517
break;
55205518
case FNC_TABLE:
5521-
qrp= JDBCTables(g, dsn, shm, tab, tabtyp, mxr, true, sjp);
5519+
qrp= JDBCTables(g, shm, tab, tabtyp, mxr, true, sjp);
55225520
break;
55235521
#if 0
55245522
case FNC_DSN:
55255523
qrp= JDBCDataSources(g, mxr, true);
55265524
break;
55275525
#endif // 0
55285526
case FNC_DRIVER:
5529-
qrp= JDBCDrivers(g, jpath, mxr, true);
5527+
qrp= JDBCDrivers(g, mxr, true);
55305528
break;
55315529
default:
55325530
sprintf(g->Message, "invalid catfunc %s", fncn);
@@ -6853,6 +6851,12 @@ static MYSQL_SYSVAR_STR(jvm_path, JvmPath,
68536851
"Path to the directory where is the JVM lib",
68546852
// check_jvm_path, update_jvm_path,
68556853
NULL, NULL, NULL);
6854+
6855+
static MYSQL_SYSVAR_STR(class_path, ClassPath,
6856+
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC,
6857+
"Java class path",
6858+
// check_class_path, update_class_path,
6859+
NULL, NULL, NULL);
68566860
#endif // JDBC_SUPPORT
68576861

68586862

@@ -6873,7 +6877,10 @@ static struct st_mysql_sys_var* connect_system_variables[]= {
68736877
MYSQL_SYSVAR(errmsg_dir_path),
68746878
#endif // XMSG
68756879
MYSQL_SYSVAR(json_grp_size),
6880+
#if defined(JDBC_SUPPORT)
68766881
MYSQL_SYSVAR(jvm_path),
6882+
MYSQL_SYSVAR(class_path),
6883+
#endif // JDBC_SUPPORT
68776884
NULL
68786885
};
68796886

storage/connect/jdbccat.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ typedef struct jdbc_parms {
2121
char *JDBCCheckConnection(PGLOBAL g, char *dsn, int cop);
2222
#endif // PROMPT_OK
2323
//PQRYRES JDBCDataSources(PGLOBAL g, int maxres, bool info);
24-
PQRYRES JDBCColumns(PGLOBAL g, char *jpath, char *db, char *table,
24+
PQRYRES JDBCColumns(PGLOBAL g, char *db, char *table,
2525
char *colpat, int maxres, bool info, PJPARM sop);
26-
PQRYRES JDBCSrcCols(PGLOBAL g, char *jpath, char *src, PJPARM sop);
27-
PQRYRES JDBCTables(PGLOBAL g, char *jpath, char *db, char *tabpat,
26+
PQRYRES JDBCSrcCols(PGLOBAL g, char *src, PJPARM sop);
27+
PQRYRES JDBCTables(PGLOBAL g, char *db, char *tabpat,
2828
char *tabtyp, int maxres, bool info, PJPARM sop);
29-
PQRYRES JDBCDrivers(PGLOBAL g, char *jpath, int maxres, bool info);
29+
PQRYRES JDBCDrivers(PGLOBAL g, int maxres, bool info);

0 commit comments

Comments
 (0)