Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
a0f47c39
Commit
a0f47c39
authored
Mar 14, 2018
by
Olivier Bertrand
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ob-10.1' into 10.1
parents
c195e051
46defc43
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
383 additions
and
171 deletions
+383
-171
storage/connect/Client.java
storage/connect/Client.java
+22
-5
storage/connect/JavaWrappers.jar
storage/connect/JavaWrappers.jar
+0
-0
storage/connect/JdbcInterface.java
storage/connect/JdbcInterface.java
+51
-3
storage/connect/PostgresqlInterface.java
storage/connect/PostgresqlInterface.java
+3
-2
storage/connect/global.h
storage/connect/global.h
+5
-1
storage/connect/ha_connect.cc
storage/connect/ha_connect.cc
+14
-7
storage/connect/jdbconn.cpp
storage/connect/jdbconn.cpp
+230
-109
storage/connect/jdbconn.h
storage/connect/jdbconn.h
+2
-9
storage/connect/mysql-test/connect/r/jdbc_postgresql.result
storage/connect/mysql-test/connect/r/jdbc_postgresql.result
+18
-17
storage/connect/mysql-test/connect/std_data/JavaWrappers.jar
storage/connect/mysql-test/connect/std_data/JavaWrappers.jar
+0
-0
storage/connect/mysql-test/connect/t/jdbc_postgresql.test
storage/connect/mysql-test/connect/t/jdbc_postgresql.test
+22
-11
storage/connect/mysql-test/connect/t/jdbconn.inc
storage/connect/mysql-test/connect/t/jdbconn.inc
+4
-3
storage/connect/plgdbsem.h
storage/connect/plgdbsem.h
+2
-1
storage/connect/tabjdbc.cpp
storage/connect/tabjdbc.cpp
+8
-3
storage/connect/tabjdbc.h
storage/connect/tabjdbc.h
+2
-0
No files found.
storage/connect/Client.java
View file @
a0f47c39
package
wrappers
;
import
java.io.BufferedReader
;
import
java.io.Console
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
import
java.sql.Date
;
import
java.sql.Time
;
import
java.sql.Timestamp
;
public
class
Client
{
static
boolean
DEBUG
=
true
;
...
...
@@ -58,6 +62,9 @@ public class Client {
String
query
;
System
.
out
.
println
(
"Successfully connected to "
+
parms
[
1
]);
s
=
jdi
.
GetQuoteString
();
System
.
out
.
println
(
"Qstr = '"
+
s
+
"'"
);
while
((
query
=
getLine
(
"Query: "
,
false
))
!=
null
)
{
n
=
jdi
.
Execute
(
query
);
System
.
out
.
println
(
"Returned n = "
+
n
);
...
...
@@ -79,7 +86,11 @@ public class Client {
private
static
void
PrintResult
(
int
ncol
)
{
// Get result set meta data
int
i
;
Date
date
=
new
Date
(
0
);
Time
time
=
new
Time
(
0
);
Timestamp
tsp
=
new
Timestamp
(
0
);
String
columnName
;
Object
job
;
// Get the column names; column indices start from 1
for
(
i
=
1
;
i
<=
ncol
;
i
++)
{
...
...
@@ -112,6 +123,7 @@ public class Client {
case
java
.
sql
.
Types
.
VARCHAR
:
case
java
.
sql
.
Types
.
LONGVARCHAR
:
case
java
.
sql
.
Types
.
CHAR
:
case
1111
:
System
.
out
.
print
(
jdi
.
StringField
(
i
,
null
));
break
;
case
java
.
sql
.
Types
.
INTEGER
:
...
...
@@ -120,14 +132,17 @@ public class Client {
case
java
.
sql
.
Types
.
BIGINT
:
System
.
out
.
print
(
jdi
.
BigintField
(
i
,
null
));
break
;
case
java
.
sql
.
Types
.
TIMESTAMP
:
System
.
out
.
print
(
jdi
.
TimestampField
(
i
,
null
));
break
;
case
java
.
sql
.
Types
.
TIME
:
System
.
out
.
print
(
jdi
.
TimeField
(
i
,
null
));
time
.
setTime
((
long
)
jdi
.
TimeField
(
i
,
null
)
*
1000
);
System
.
out
.
print
(
time
);
break
;
case
java
.
sql
.
Types
.
DATE
:
System
.
out
.
print
(
jdi
.
DateField
(
i
,
null
));
date
.
setTime
((
long
)
jdi
.
DateField
(
i
,
null
)
*
1000
);
System
.
out
.
print
(
date
);
break
;
case
java
.
sql
.
Types
.
TIMESTAMP
:
tsp
.
setTime
((
long
)
jdi
.
TimestampField
(
i
,
null
)
*
1000
);
System
.
out
.
print
(
tsp
);
break
;
case
java
.
sql
.
Types
.
SMALLINT
:
System
.
out
.
print
(
jdi
.
IntField
(
i
,
null
));
...
...
@@ -141,6 +156,8 @@ public class Client {
case
java
.
sql
.
Types
.
BOOLEAN
:
System
.
out
.
print
(
jdi
.
BooleanField
(
i
,
null
));
default
:
job
=
jdi
.
ObjectField
(
i
,
null
);
System
.
out
.
print
(
job
.
toString
());
break
;
}
// endswitch Type
...
...
storage/connect/JavaWrappers.jar
View file @
a0f47c39
This diff was suppressed by a .gitattributes entry.
storage/connect/JdbcInterface.java
View file @
a0f47c39
package
wrappers
;
import
java.math.*
;
import
java.sql.*
;
import
java.math.BigDecimal
;
import
java.sql.Connection
;
import
java.sql.DatabaseMetaData
;
import
java.sql.Date
;
import
java.sql.Driver
;
import
java.sql.DriverManager
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
import
java.sql.ResultSetMetaData
;
import
java.sql.SQLException
;
import
java.sql.Statement
;
import
java.sql.Time
;
import
java.sql.Timestamp
;
import
java.util.Collections
;
import
java.util.Hashtable
;
import
java.util.List
;
import
java.util.UUID
;
import
javax.sql.DataSource
;
...
...
@@ -223,6 +235,24 @@ public class JdbcInterface {
}
// end of SetTimestampParm
public
void
SetUuidParm
(
int
i
,
String
s
)
{
try
{
UUID
uuid
;
if
(
s
==
null
)
uuid
=
null
;
else
if
(
s
.
isEmpty
())
uuid
=
UUID
.
randomUUID
();
else
uuid
=
UUID
.
fromString
(
s
);
pstmt
.
setObject
(
i
,
uuid
);
}
catch
(
Exception
e
)
{
SetErrmsg
(
e
);
}
// end try/catch
}
// end of SetUuidParm
public
int
SetNullParm
(
int
i
,
int
typ
)
{
int
rc
=
0
;
...
...
@@ -481,6 +511,8 @@ public class JdbcInterface {
System
.
out
.
println
(
"Executing query '"
+
query
+
"'"
);
try
{
if
(
rs
!=
null
)
rs
.
close
();
rs
=
stmt
.
executeQuery
(
query
);
rsmd
=
rs
.
getMetaData
();
ncol
=
rsmd
.
getColumnCount
();
...
...
@@ -708,7 +740,7 @@ public class JdbcInterface {
return
0
;
}
// end of TimestampField
public
Object
ObjectField
(
int
n
,
String
name
)
{
public
Object
ObjectField
(
int
n
,
String
name
)
{
if
(
rs
==
null
)
{
System
.
out
.
println
(
"No result set"
);
}
else
try
{
...
...
@@ -720,6 +752,22 @@ public class JdbcInterface {
return
null
;
}
// end of ObjectField
public
String
UuidField
(
int
n
,
String
name
)
{
Object
job
;
if
(
rs
==
null
)
{
System
.
out
.
println
(
"No result set"
);
}
else
try
{
job
=
(
n
>
0
)
?
rs
.
getObject
(
n
)
:
rs
.
getObject
(
name
);
return
job
.
toString
();
}
catch
(
SQLException
se
)
{
SetErrmsg
(
se
);
}
// end try/catch
return
null
;
}
// end of UuidField
public
int
GetDrivers
(
String
[]
s
,
int
mxs
)
{
int
n
=
0
;
List
<
Driver
>
drivers
=
Collections
.
list
(
DriverManager
.
getDrivers
());
...
...
storage/connect/PostgresqlInterface.java
View file @
a0f47c39
package
wrappers
;
import
java.sql.
*
;
import
java.sql.
SQLException
;
import
java.util.Hashtable
;
import
javax.sql.DataSource
;
import
org.postgresql.jdbc2.optional.PoolingDataSource
;
public
class
PostgresqlInterface
extends
JdbcInterface
{
...
...
@@ -19,7 +20,7 @@ public class PostgresqlInterface extends JdbcInterface {
}
// end of constructor
@Override
@Override
public
int
JdbcConnect
(
String
[]
parms
,
int
fsize
,
boolean
scrollable
)
{
int
rc
=
0
;
String
url
=
parms
[
1
];
...
...
storage/connect/global.h
View file @
a0f47c39
...
...
@@ -220,7 +220,6 @@ DllExport BOOL PlugIsAbsolutePath(LPCSTR path);
DllExport
bool
AllocSarea
(
PGLOBAL
,
uint
);
DllExport
void
FreeSarea
(
PGLOBAL
);
DllExport
BOOL
PlugSubSet
(
PGLOBAL
,
void
*
,
uint
);
void
*
PlugSubAlloc
(
PGLOBAL
,
void
*
,
size_t
);
// Does throw
DllExport
char
*
PlugDup
(
PGLOBAL
g
,
const
char
*
str
);
DllExport
void
*
MakePtr
(
void
*
,
OFFSET
);
DllExport
void
htrc
(
char
const
*
fmt
,
...);
...
...
@@ -231,4 +230,9 @@ DllExport uint GetTraceValue(void);
}
// extern "C"
#endif
/***********************************************************************/
/* Non exported routine declarations. */
/***********************************************************************/
void
*
PlugSubAlloc
(
PGLOBAL
,
void
*
,
size_t
);
// Does throw
/*-------------------------- End of Global.H --------------------------*/
storage/connect/ha_connect.cc
View file @
a0f47c39
...
...
@@ -174,9 +174,9 @@
#define JSONMAX 10 // JSON Default max grp size
extern
"C"
{
char
version
[]
=
"Version 1.06.000
6 February 02
, 2018"
;
char
version
[]
=
"Version 1.06.000
7 March 11
, 2018"
;
#if defined(__WIN__)
char
compver
[]
=
"Version 1.06.000
6
"
__DATE__
" "
__TIME__
;
char
compver
[]
=
"Version 1.06.000
7
"
__DATE__
" "
__TIME__
;
char
slash
=
'\\'
;
#else // !__WIN__
char
slash
=
'/'
;
...
...
@@ -288,11 +288,16 @@ static MYSQL_THDVAR_SET(
0
,
// def (NO)
&
xtrace_typelib
);
// typelib
// Getting exact info values
// Getting exact info values
static
MYSQL_THDVAR_BOOL
(
exact_info
,
PLUGIN_VAR_RQCMDARG
,
"Getting exact info values"
,
NULL
,
NULL
,
0
);
// Enabling cond_push
static
MYSQL_THDVAR_BOOL
(
cond_push
,
PLUGIN_VAR_RQCMDARG
,
"Enabling cond_push"
,
NULL
,
NULL
,
1
);
// YES by default
/**
Temporary file usage:
no: Not using temporary file
...
...
@@ -427,6 +432,7 @@ handlerton *connect_hton= NULL;
uint
GetTraceValue
(
void
)
{
return
(
uint
)(
connect_hton
?
THDVAR
(
current_thd
,
xtrace
)
:
0
);}
bool
ExactInfo
(
void
)
{
return
THDVAR
(
current_thd
,
exact_info
);}
bool
CondPushEnabled
(
void
)
{
return
THDVAR
(
current_thd
,
cond_push
);}
USETEMP
UseTemp
(
void
)
{
return
(
USETEMP
)
THDVAR
(
current_thd
,
use_tempfile
);}
int
GetConvSize
(
void
)
{
return
THDVAR
(
current_thd
,
conv_size
);}
TYPCONV
GetTypeConv
(
void
)
{
return
(
TYPCONV
)
THDVAR
(
current_thd
,
type_conv
);}
...
...
@@ -3196,7 +3202,7 @@ const COND *ha_connect::cond_push(const COND *cond)
{
DBUG_ENTER
(
"ha_connect::cond_push"
);
if
(
tdbp
)
{
if
(
tdbp
&&
CondPushEnabled
()
)
{
PGLOBAL
&
g
=
xp
->
g
;
AMT
tty
=
tdbp
->
GetAmType
();
bool
x
=
(
tty
==
TYPE_AM_MYX
||
tty
==
TYPE_AM_XDBC
);
...
...
@@ -7243,7 +7249,8 @@ static struct st_mysql_sys_var* connect_system_variables[]= {
#if defined(JAVA_SUPPORT) || defined(CMGO_SUPPORT)
MYSQL_SYSVAR
(
enable_mongo
),
#endif // JAVA_SUPPORT || CMGO_SUPPORT
NULL
MYSQL_SYSVAR
(
cond_push
),
NULL
};
maria_declare_plugin
(
connect
)
...
...
@@ -7256,10 +7263,10 @@ maria_declare_plugin(connect)
PLUGIN_LICENSE_GPL
,
connect_init_func
,
/* Plugin Init */
connect_done_func
,
/* Plugin Deinit */
0x010
6
,
/* version number (1.05) */
0x010
7
,
/* version number (1.05) */
NULL
,
/* status variables */
connect_system_variables
,
/* system variables */
"1.06.000
6
"
,
/* string version */
"1.06.000
7
"
,
/* string version */
MariaDB_PLUGIN_MATURITY_STABLE
/* maturity */
}
maria_declare_plugin_end
;
storage/connect/jdbconn.cpp
View file @
a0f47c39
This diff is collapsed.
Click to expand it.
storage/connect/jdbconn.h
View file @
a0f47c39
...
...
@@ -29,6 +29,7 @@ class JDBConn : public JAVAConn {
// Attributes
public:
char
*
GetQuoteChar
(
void
)
{
return
m_IDQuoteChar
;
}
bool
SetUUID
(
PGLOBAL
g
,
PTDBJDBC
tjp
);
virtual
int
GetMaxValue
(
int
infotype
);
public:
...
...
@@ -58,13 +59,6 @@ class JDBConn : public JAVAConn {
protected:
// Members
#if 0
JavaVM *jvm; // Pointer to the JVM (Java Virtual Machine)
JNIEnv *env; // Pointer to native interface
jclass jdi; // Pointer to the java wrapper class
jobject job; // The java wrapper class object
jmethodID errid; // The GetErrmsg method ID
#endif // 0
jmethodID
xqid
;
// The ExecuteQuery method ID
jmethodID
xuid
;
// The ExecuteUpdate method ID
jmethodID
xid
;
// The Execute method ID
...
...
@@ -84,8 +78,7 @@ class JDBConn : public JAVAConn {
jmethodID
timfldid
;
// The TimeField method ID
jmethodID
tspfldid
;
// The TimestampField method ID
jmethodID
bigfldid
;
// The BigintField method ID
// PCSZ Msg;
// PCSZ m_Wrap;
jmethodID
uidfldid
;
// The UuidField method ID
char
m_IDQuoteChar
[
2
];
PCSZ
m_Pwd
;
int
m_Ncol
;
...
...
storage/connect/mysql-test/connect/r/jdbc_postgresql.result
View file @
a0f47c39
SET GLOBAL connect_class_path='C:/MariaDB-10.2/MariaDB/storage/connect/mysql-test/connect/std_data/JavaWrappers.jar;C:/Jconnectors/postgresql-42.2.1.jar';
CREATE TABLE t2 (
command varchar(128) not null,
number int(5) not null flag=1,
message varchar(255) flag=2)
ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='jdbc:postgresql://localhost/mtr'
OPTION_LIST='User=mtr,Password=mtr,Schema=public,Execsrc=1';
ENGINE=CONNECT TABLE_TYPE=JDBC
CONNECTION='jdbc:postgresql://localhost/test?user=postgres&password=tinono'
OPTION_LIST='Execsrc=1';
SELECT * FROM t2 WHERE command='drop table employee';
command number message
drop table employee 0 Execute: org.postgresql.util.PSQLException: ERREUR: la table « employee » n'existe pas
...
...
@@ -14,17 +16,18 @@ SELECT * FROM t2 WHERE command = "insert into employee values(4567,'Johnson', 'E
command number message
insert into employee values(4567,'Johnson', 'Engineer', 12560.50) 1 Affected rows
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=tables
CONNECTION='jdbc:postgresql://localhost/
mtr
'
OPTION_LIST='
User=mtr,Password=mtr,Schema=public,
Tabtype=TABLE,Maxres=10';
CONNECTION='jdbc:postgresql://localhost/
test?user=postgres&password=tinono
'
OPTION_LIST='Tabtype=TABLE,Maxres=10';
SELECT * FROM t1;
Table_Cat Table_Schema Table_Name Table_Type Remark
public employee TABLE NULL
public t1 TABLE NULL
public t2 TABLE NULL
NULL public employee TABLE NULL
NULL public t1 TABLE NULL
NULL public t2 TABLE NULL
NULL public tchar TABLE NULL
NULL public testuuid TABLE NULL
DROP TABLE t1;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CATFUNC=columns
CONNECTION='jdbc:postgresql://localhost/mtr' tabname=employee
OPTION_LIST='User=mtr,Password=mtr,Maxres=10';
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC tabname=employee CATFUNC=columns
CONNECTION='jdbc:postgresql://localhost/test?user=postgres&password=tinono';
SELECT * FROM t1;
Table_Cat Table_Schema Table_Name Column_Name Data_Type Type_Name Column_Size Buffer_Length Decimal_Digits Radix Nullable Remarks
NULL public employee id 4 int4 10 0 0 10 0 NULL
...
...
@@ -34,13 +37,14 @@ NULL public employee salary 2 numeric 8 0 2 10 1 NULL
DROP TABLE t1;
CREATE SERVER 'postgresql' FOREIGN DATA WRAPPER 'postgresql' OPTIONS (
HOST 'localhost',
DATABASE '
mtr
',
USER '
mtr
',
PASSWORD '
mtr
',
DATABASE '
test
',
USER '
postgres
',
PASSWORD '
tinono
',
PORT 0,
SOCKET '',
OWNER 'root');
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC CONNECTION='postgresql/public.employee';
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=JDBC
CONNECTION='postgresql/public.employee';
SELECT * FROM t1;
id name title salary
4567 Johnson Engineer 12560.50
...
...
@@ -60,6 +64,3 @@ SELECT * FROM t2 WHERE command='drop table employee';
command number message
drop table employee 0 Affected rows
DROP TABLE t2;
SET GLOBAL connect_jvm_path=NULL;
SET GLOBAL connect_class_path=NULL;
SET GLOBAL time_zone = SYSTEM;
storage/connect/mysql-test/connect/std_data/JavaWrappers.jar
0 → 100644
View file @
a0f47c39
This diff was suppressed by a .gitattributes entry.
storage/connect/mysql-test/connect/t/jdbc_postgresql.test
View file @
a0f47c39
...
...
@@ -3,25 +3,32 @@
#
# This test is run against Postgresql driver
#
eval
SET
GLOBAL
connect_class_path
=
'$MTR_SUITE_DIR/std_data/JavaWrappers.jar;C:/Jconnectors/postgresql-42.2.1.jar'
;
CREATE
TABLE
t2
(
command
varchar
(
128
)
not
null
,
number
int
(
5
)
not
null
flag
=
1
,
message
varchar
(
255
)
flag
=
2
)
ENGINE
=
CONNECT
TABLE_TYPE
=
JDBC
CONNECTION
=
'jdbc:postgresql://localhost/mtr'
OPTION_LIST
=
'User=mtr,Password=mtr,Schema=public,Execsrc=1'
;
ENGINE
=
CONNECT
TABLE_TYPE
=
JDBC
CONNECTION
=
'jdbc:postgresql://localhost/test?user=postgres&password=tinono'
OPTION_LIST
=
'Execsrc=1'
;
#CONNECTION='jdbc:postgresql://localhost/mtr'
#OPTION_LIST='User=mtr,Password=mtr,Schema=public,Execsrc=1';
SELECT
*
FROM
t2
WHERE
command
=
'drop table employee'
;
SELECT
*
FROM
t2
WHERE
command
=
'create table employee (id int not null, name varchar(32), title char(16), salary decimal(8,2))'
;
SELECT
*
FROM
t2
WHERE
command
=
"insert into employee values(4567,'Johnson', 'Engineer', 12560.50)"
;
CREATE
TABLE
t1
ENGINE
=
CONNECT
TABLE_TYPE
=
JDBC
CATFUNC
=
tables
CONNECTION
=
'jdbc:postgresql://localhost/mtr'
OPTION_LIST
=
'User=mtr,Password=mtr,Schema=public,Tabtype=TABLE,Maxres=10'
;
CONNECTION
=
'jdbc:postgresql://localhost/test?user=postgres&password=tinono'
OPTION_LIST
=
'Tabtype=TABLE,Maxres=10'
;
#CONNECTION='jdbc:postgresql://localhost/mtr'
#OPTION_LIST='User=mtr,Password=mtr,Schema=public,Tabtype=TABLE,Maxres=10';
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
ENGINE
=
CONNECT
TABLE_TYPE
=
JDBC
CATFUNC
=
columns
CONNECTION
=
'jdbc:postgresql://localhost/mtr'
tabname
=
employee
OPTION_LIST
=
'User=mtr,Password=mtr,Maxres=10'
;
CREATE
TABLE
t1
ENGINE
=
CONNECT
TABLE_TYPE
=
JDBC
tabname
=
employee
CATFUNC
=
columns
CONNECTION
=
'jdbc:postgresql://localhost/test?user=postgres&password=tinono'
;
#CONNECTION='jdbc:postgresql://localhost/mtr' tabname=employee;
#OPTION_LIST='User=mtr,Password=mtr,Maxres=10';
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
...
...
@@ -30,14 +37,18 @@ DROP TABLE t1;
#
CREATE
SERVER
'postgresql'
FOREIGN
DATA
WRAPPER
'postgresql'
OPTIONS
(
HOST
'localhost'
,
DATABASE
'
mtr
'
,
USER
'
mtr
'
,
PASSWORD
'
mtr
'
,
DATABASE
'
test
'
,
USER
'
postgres
'
,
PASSWORD
'
tinono
'
,
PORT
0
,
SOCKET
''
,
OWNER
'root'
);
#DATABASE 'mtr',
#USER 'mtr',
#PASSWORD 'mtr',
CREATE
TABLE
t1
ENGINE
=
CONNECT
TABLE_TYPE
=
JDBC
CONNECTION
=
'postgresql/public.employee'
;
CREATE
TABLE
t1
ENGINE
=
CONNECT
TABLE_TYPE
=
JDBC
CONNECTION
=
'postgresql/public.employee'
;
SELECT
*
FROM
t1
;
INSERT
INTO
t1
VALUES
(
3126
,
'Smith'
,
'Clerk'
,
5230.00
);
UPDATE
t1
SET
salary
=
salary
+
100.00
;
...
...
storage/connect/mysql-test/connect/t/jdbconn.inc
View file @
a0f47c39
...
...
@@ -22,10 +22,11 @@ DROP TABLE t1;
# 1 - The current directory.
# 2 - The paths of the connect_class_path global variable.
# 3 - The paths of the CLASSPATH environment variable.
# In this test we use an executable jar file that contains all what is needed.
eval
SET
GLOBAL
connect_class_path
=
'$MTR_SUITE_DIR/std_data/JdbcMariaDB.jar'
;
# In this test we use an executable jar file that contains all the eisting wrappers.
#eval SET GLOBAL connect_class_path='$MTR_SUITE_DIR/std_data/JdbcMariaDB.jar';
eval
SET
GLOBAL
connect_class_path
=
'$MTR_SUITE_DIR/std_data/JavaWrappers.jar'
;
# Paths to the JDK classes and to the
MySQL and MariaDB drivers can
be defined in the CLASSPATH environment variable
# Paths to the JDK classes and to the
JDBC drivers should
be defined in the CLASSPATH environment variable
#CREATE FUNCTION envar RETURNS STRING SONAME 'ha_connect.dll';
#SELECT envar('CLASSPATH');
...
...
storage/connect/plgdbsem.h
View file @
a0f47c39
...
...
@@ -362,7 +362,8 @@ enum COLUSE {U_P = 0x01, /* the projection list. */
U_IS_NULL
=
0x80
,
/* The column has a null value */
U_SPECIAL
=
0x100
,
/* The column is special */
U_UNSIGNED
=
0x200
,
/* The column type is unsigned */
U_ZEROFILL
=
0x400
};
/* The column is zero filled */
U_ZEROFILL
=
0x400
,
/* The column is zero filled */
U_UUID
=
0x800
};
/* The column is a UUID */
/***********************************************************************/
/* DB description class and block pointer definitions. */
...
...
storage/connect/tabjdbc.cpp
View file @
a0f47c39
...
...
@@ -605,6 +605,10 @@ bool TDBJDBC::OpenDB(PGLOBAL g)
else
if
(
Quoted
)
Quote
=
Jcp
->
GetQuoteChar
();
if
(
Mode
!=
MODE_READ
&&
Mode
!=
MODE_READX
)
if
(
Jcp
->
SetUUID
(
g
,
this
))
PushWarning
(
g
,
this
,
1
);
Use
=
USE_OPEN
;
// Do it now in case we are recursively called
/*********************************************************************/
...
...
@@ -970,6 +974,7 @@ void TDBJDBC::CloseDB(PGLOBAL g)
JDBCCOL
::
JDBCCOL
(
PCOLDEF
cdp
,
PTDB
tdbp
,
PCOL
cprec
,
int
i
,
PCSZ
am
)
:
EXTCOL
(
cdp
,
tdbp
,
cprec
,
i
,
am
)
{
uuid
=
false
;
}
// end of JDBCCOL constructor
/***********************************************************************/
...
...
@@ -977,6 +982,7 @@ JDBCCOL::JDBCCOL(PCOLDEF cdp, PTDB tdbp, PCOL cprec, int i, PCSZ am)
/***********************************************************************/
JDBCCOL
::
JDBCCOL
(
void
)
:
EXTCOL
()
{
uuid
=
false
;
}
// end of JDBCCOL constructor
/***********************************************************************/
...
...
@@ -985,12 +991,11 @@ JDBCCOL::JDBCCOL(void) : EXTCOL()
/***********************************************************************/
JDBCCOL
::
JDBCCOL
(
JDBCCOL
*
col1
,
PTDB
tdbp
)
:
EXTCOL
(
col1
,
tdbp
)
{
uuid
=
col1
->
uuid
;
}
// end of JDBCCOL copy constructor
/***********************************************************************/
/* ReadColumn: when SQLFetch is used there is nothing to do as the */
/* column buffer was bind to the record set. This is also the case */
/* when calculating MaxSize (Bufp is NULL even when Rows is not). */
/* ReadColumn: retrieve the column value via the JDBC driver. */
/***********************************************************************/
void
JDBCCOL
::
ReadColumn
(
PGLOBAL
g
)
{
...
...
storage/connect/tabjdbc.h
View file @
a0f47c39
...
...
@@ -101,6 +101,7 @@ class TDBJDBC : public TDBEXT {
/***********************************************************************/
class
JDBCCOL
:
public
EXTCOL
{
friend
class
TDBJDBC
;
friend
class
JDBConn
;
public:
// Constructors
JDBCCOL
(
PCOLDEF
cdp
,
PTDB
tdbp
,
PCOL
cprec
,
int
i
,
PCSZ
am
=
"JDBC"
);
...
...
@@ -119,6 +120,7 @@ class JDBCCOL : public EXTCOL {
JDBCCOL
(
void
);
// Members
bool
uuid
;
// For PostgreSQL
};
// end of class JDBCCOL
/***********************************************************************/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment