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
6b0fc1ee
Commit
6b0fc1ee
authored
Jan 27, 2019
by
Olivier Bertrand
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ob-10.1' into 10.1
parents
e3b3e225
e0c147c2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
100 additions
and
44 deletions
+100
-44
storage/connect/ha_connect.cc
storage/connect/ha_connect.cc
+14
-7
storage/connect/tabext.cpp
storage/connect/tabext.cpp
+41
-2
storage/connect/tabext.h
storage/connect/tabext.h
+3
-2
storage/connect/tabjdbc.cpp
storage/connect/tabjdbc.cpp
+38
-29
storage/connect/tabjson.cpp
storage/connect/tabjson.cpp
+4
-4
No files found.
storage/connect/ha_connect.cc
View file @
6b0fc1ee
...
...
@@ -170,9 +170,9 @@
#define JSONMAX 10 // JSON Default max grp size
extern
"C"
{
char
version
[]
=
"Version 1.06.000
8 October 06, 2018
"
;
char
version
[]
=
"Version 1.06.000
9 January 27, 2019
"
;
#if defined(__WIN__)
char
compver
[]
=
"Version 1.06.000
8
"
__DATE__
" "
__TIME__
;
char
compver
[]
=
"Version 1.06.000
9
"
__DATE__
" "
__TIME__
;
char
slash
=
'\\'
;
#else // !__WIN__
char
slash
=
'/'
;
...
...
@@ -1914,9 +1914,11 @@ int ha_connect::OpenTable(PGLOBAL g, bool del)
break
;
}
// endswitch xmode
if
(
xmod
!=
MODE_INSERT
||
tdbp
->
GetAmType
()
==
TYPE_AM_MYSQL
||
tdbp
->
GetAmType
()
==
TYPE_AM_ODBC
||
tdbp
->
GetAmType
()
==
TYPE_AM_JDBC
)
{
// g->More is 1 when executing commands from triggers
if
(
!
g
->
More
&&
(
xmod
!=
MODE_INSERT
||
tdbp
->
GetAmType
()
==
TYPE_AM_MYSQL
||
tdbp
->
GetAmType
()
==
TYPE_AM_ODBC
||
tdbp
->
GetAmType
()
==
TYPE_AM_JDBC
))
{
// Get the list of used fields (columns)
char
*
p
;
unsigned
int
k1
,
k2
,
n1
,
n2
;
...
...
@@ -4631,7 +4633,9 @@ MODE ha_connect::CheckMode(PGLOBAL g, THD *thd,
break
;
case
SQLCOM_CREATE_VIEW
:
case
SQLCOM_DROP_VIEW
:
newmode
=
MODE_ANY
;
case
SQLCOM_CREATE_TRIGGER
:
case
SQLCOM_DROP_TRIGGER
:
newmode
=
MODE_ANY
;
break
;
case
SQLCOM_ALTER_TABLE
:
*
chk
=
true
;
...
...
@@ -4674,6 +4678,9 @@ int ha_connect::start_stmt(THD *thd, thr_lock_type lock_type)
PGLOBAL
g
=
GetPlug
(
thd
,
xp
);
DBUG_ENTER
(
"ha_connect::start_stmt"
);
if
(
table
->
triggers
)
g
->
More
=
1
;
// We don't know which columns are used by the trigger
if
(
check_privileges
(
thd
,
GetTableOptionStruct
(),
table
->
s
->
db
.
str
,
true
))
DBUG_RETURN
(
HA_ERR_INTERNAL_ERROR
);
...
...
@@ -7310,7 +7317,7 @@ maria_declare_plugin(connect)
0x0106
,
/* version number (1.06) */
NULL
,
/* status variables */
connect_system_variables
,
/* system variables */
"1.06.000
8
"
,
/* string version */
"1.06.000
9
"
,
/* string version */
MariaDB_PLUGIN_MATURITY_STABLE
/* maturity */
}
maria_declare_plugin_end
;
storage/connect/tabext.cpp
View file @
6b0fc1ee
/************* Tabext C++ Functions Source Code File (.CPP) ************/
/* Name: TABEXT.CPP Version 1.
0
*/
/* Name: TABEXT.CPP Version 1.
1
*/
/* */
/* (C) Copyright to the author Olivier BERTRAND 2017
*/
/* (C) Copyright to the author Olivier BERTRAND 2017
- 2019
*/
/* */
/* This file contains the TBX, TDB and OPJOIN classes functions. */
/***********************************************************************/
...
...
@@ -445,6 +445,43 @@ bool TDBEXT::MakeSQL(PGLOBAL g, bool cnt)
return
false
;
}
// end of MakeSQL
/***********************************************************************/
/* Remove the NAME_CONST functions that are added by procedures. */
/***********************************************************************/
void
TDBEXT
::
RemoveConst
(
PGLOBAL
g
,
char
*
stmt
)
{
char
*
p
,
*
p2
;
char
val
[
1025
],
nval
[
1025
];
int
n
,
nc
;
while
((
p
=
strstr
(
stmt
,
"NAME_CONST"
)))
if
((
n
=
sscanf
(
p
,
"%*[^,],%1024[^)])%n"
,
val
,
&
nc
)))
{
if
(
trace
(
33
))
htrc
(
"p=%s
\n
n=%d val=%s nc=%d
\n
"
,
p
,
n
,
val
,
nc
);
*
p
=
0
;
if
((
p2
=
strstr
(
val
,
"'"
)))
{
if
((
n
=
sscanf
(
p2
,
"%*['
\\
]%1024[^'
\\
]"
,
nval
)))
{
if
(
trace
(
33
))
htrc
(
"p2=%s
\n
n=%d nval=%s
\n
"
,
p2
,
n
,
nval
);
strcat
(
strcat
(
strcat
(
strcat
(
stmt
,
"'"
),
nval
),
"'"
),
p
+
nc
);
}
else
break
;
}
else
strcat
(
strcat
(
strcat
(
strcat
(
stmt
,
"("
),
val
),
")"
),
p
+
nc
);
if
(
trace
(
33
))
htrc
(
"stmt=%s
\n
"
,
stmt
);
}
else
break
;
return
;
}
// end of RemoveConst
/***********************************************************************/
/* MakeCommand: make the Update or Delete statement to send to the */
/* MySQL server. Limited to remote values and filtering. */
...
...
@@ -524,6 +561,8 @@ bool TDBEXT::MakeCommand(PGLOBAL g)
stmt
[
i
++
]
=
(
Qrystr
[
k
]
==
'`'
)
?
q
:
Qrystr
[
k
];
}
while
(
Qrystr
[
k
++
]);
RemoveConst
(
g
,
stmt
);
if
(
body
)
strcat
(
stmt
,
body
);
...
...
storage/connect/tabext.h
View file @
6b0fc1ee
/*************** Tabext H Declares Source Code File (.H) ***************/
/* Name: TABEXT.H Version 1.
0
*/
/* Name: TABEXT.H Version 1.
1
*/
/* */
/* (C) Copyright to the author Olivier BERTRAND 2017
*/
/* (C) Copyright to the author Olivier BERTRAND 2017
- 2019
*/
/* */
/* This is the EXTDEF, TABEXT and EXTCOL classes definitions. */
/***********************************************************************/
...
...
@@ -130,6 +130,7 @@ class DllExport TDBEXT : public TDB {
virtual
bool
MakeSQL
(
PGLOBAL
g
,
bool
cnt
);
//virtual bool MakeInsert(PGLOBAL g);
virtual
bool
MakeCommand
(
PGLOBAL
g
);
void
RemoveConst
(
PGLOBAL
g
,
char
*
stmt
);
int
Decode
(
PCSZ
utf
,
char
*
buf
,
size_t
n
);
// Members
...
...
storage/connect/tabjdbc.cpp
View file @
6b0fc1ee
/************* TabJDBC C++ Program Source Code File (.CPP) *************/
/* PROGRAM NAME: TABJDBC */
/* ------------- */
/* Version 1.
2
*/
/* Version 1.
3
*/
/* */
/* COPYRIGHT: */
/* ---------- */
/* (C) Copyright to the author Olivier BERTRAND 2016-201
7
*/
/* (C) Copyright to the author Olivier BERTRAND 2016-201
9
*/
/* */
/* WHAT THIS PROGRAM DOES: */
/* ----------------------- */
...
...
@@ -185,10 +185,10 @@ int JDBCDEF::ParseURL(PGLOBAL g, char *url, bool b)
}
else
// host is a URL
Url
=
PlugDup
(
g
,
server
->
host
);
if
(
server
->
username
)
if
(
!
Username
&&
server
->
username
)
Username
=
PlugDup
(
g
,
server
->
username
);
if
(
server
->
password
)
if
(
!
Password
&&
server
->
password
)
Password
=
PlugDup
(
g
,
server
->
password
);
return
RC_NF
;
...
...
@@ -558,33 +558,42 @@ bool TDBJDBC::OpenDB(PGLOBAL g)
this
,
Tdb_No
,
Use
,
Mode
);
if
(
Use
==
USE_OPEN
)
{
/*******************************************************************/
/* Table already open, just replace it at its beginning. */
/*******************************************************************/
if
(
Memory
==
1
)
{
if
((
Qrp
=
Jcp
->
AllocateResult
(
g
,
this
)))
Memory
=
2
;
// Must be filled
else
Memory
=
0
;
// Allocation failed, don't use it
}
else
if
(
Memory
==
2
)
Memory
=
3
;
// Ok to use memory result
if
(
Memory
<
3
)
{
// Method will depend on cursor type
if
((
Rbuf
=
Query
?
Jcp
->
Rewind
(
Query
->
GetStr
())
:
0
)
<
0
)
if
(
Mode
!=
MODE_READX
)
{
Jcp
->
Close
();
return
true
;
}
else
Rbuf
=
0
;
if
(
Mode
==
MODE_READ
||
Mode
==
MODE_READX
)
{
/*****************************************************************/
/* Table already open, just replace it at its beginning. */
/*****************************************************************/
if
(
Memory
==
1
)
{
if
((
Qrp
=
Jcp
->
AllocateResult
(
g
,
this
)))
Memory
=
2
;
// Must be filled
else
Memory
=
0
;
// Allocation failed, don't use it
}
else
Rbuf
=
Qrp
->
Nblin
;
}
else
if
(
Memory
==
2
)
Memory
=
3
;
// Ok to use memory result
if
(
Memory
<
3
)
{
// Method will depend on cursor type
if
((
Rbuf
=
Query
?
Jcp
->
Rewind
(
Query
->
GetStr
())
:
0
)
<
0
)
if
(
Mode
!=
MODE_READX
)
{
Jcp
->
Close
();
return
true
;
}
else
Rbuf
=
0
;
}
else
Rbuf
=
Qrp
->
Nblin
;
CurNum
=
0
;
Fpos
=
0
;
Curpos
=
1
;
}
else
if
(
Mode
==
MODE_UPDATE
||
Mode
==
MODE_DELETE
)
{
// new update coming from a trigger or procedure
Query
=
NULL
;
SetCondFil
(
NULL
);
Qrystr
=
To_Def
->
GetStringCatInfo
(
g
,
"Query_String"
,
"?"
);
}
else
{
//if (Mode == MODE_INSERT)
}
// endif Mode
CurNum
=
0
;
Fpos
=
0
;
Curpos
=
1
;
return
false
;
}
// endif use
...
...
storage/connect/tabjson.cpp
View file @
6b0fc1ee
/************* tabjson C++ Program Source Code File (.CPP) *************/
/* PROGRAM NAME: tabjson Version 1.
6
*/
/* (C) Copyright to the author Olivier BERTRAND 2014 - 201
8
*/
/* PROGRAM NAME: tabjson Version 1.
7
*/
/* (C) Copyright to the author Olivier BERTRAND 2014 - 201
9
*/
/* This program are the JSON class DB execution routines. */
/***********************************************************************/
...
...
@@ -110,8 +110,8 @@ PQRYRES JSONColumns(PGLOBAL g, PCSZ db, PCSZ dsn, PTOS topt, bool info)
buftyp
,
fldtyp
,
length
,
false
,
false
);
crp
=
qrp
->
Colresp
->
Next
->
Next
->
Next
->
Next
->
Next
->
Next
;
crp
->
Name
=
"Nullable"
;
crp
->
Next
->
Name
=
"Jpath"
;
crp
->
Name
=
PlugDup
(
g
,
"Nullable"
)
;
crp
->
Next
->
Name
=
PlugDup
(
g
,
"Jpath"
)
;
if
(
info
||
!
qrp
)
return
qrp
;
...
...
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