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
464947e6
Commit
464947e6
authored
Mar 22, 2015
by
Olivier Bertrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fix a bug that caused a crash when doing delete on a json table with wrong syntax file
- Suppress MYSQL_SUPPORT preprocessor variable
parent
7733b247
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
28 additions
and
70 deletions
+28
-70
.gitignore
.gitignore
+1
-0
storage/connect/CMakeLists.txt
storage/connect/CMakeLists.txt
+15
-24
storage/connect/ha_connect.cc
storage/connect/ha_connect.cc
+4
-6
storage/connect/mycat.cc
storage/connect/mycat.cc
+0
-6
storage/connect/tabjson.cpp
storage/connect/tabjson.cpp
+5
-11
storage/connect/taboccur.cpp
storage/connect/taboccur.cpp
+0
-2
storage/connect/tabtbl.cpp
storage/connect/tabtbl.cpp
+0
-2
storage/connect/tabutil.cpp
storage/connect/tabutil.cpp
+3
-17
storage/connect/tabxcl.cpp
storage/connect/tabxcl.cpp
+0
-2
No files found.
.gitignore
View file @
464947e6
...
...
@@ -293,6 +293,7 @@ storage/mroonga/vendor/groonga/src/suggest/groonga-suggest-create-dataset
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
[Rr]eleaseWithDebInfo/
x64/
x86/
build/
...
...
storage/connect/CMakeLists.txt
View file @
464947e6
...
...
@@ -21,18 +21,18 @@ ha_connect.cc connect.cc user_connect.cc mycat.cc
fmdlex.c osutil.c plugutil.c rcmsg.c rcmsg.h
array.cpp blkfil.cpp colblk.cpp csort.cpp
filamap.cpp filamdbf.cpp filamfix.cpp filamtxt.cpp filamvct.cpp filamzip.cpp
filter.cpp json.cpp jsonudf.cpp maputil.cpp my
util.cpp plgdbutl.cpp reldef
.cpp
tabcol.cpp tabdos.cpp tabfix.cpp tabfmt.cpp tabjson.cpp table.cpp tabmul
.cpp
tab
occur.cpp tabpivot.cpp tabsys.cpp tabtbl.cpp tabutil.cpp tabvct
.cpp
tabvir.cpp tabxcl.cpp valblk.cpp value.cpp xindex.cpp xobject.cpp
filter.cpp json.cpp jsonudf.cpp maputil.cpp my
conn.cpp myutil.cpp plgdbutl
.cpp
reldef.cpp tabcol.cpp tabdos.cpp tabfix.cpp tabfmt.cpp tabjson.cpp table
.cpp
tab
mul.cpp tabmysql.cpp taboccur.cpp tabpivot.cpp tabsys.cpp tabtbl.cpp tabutil
.cpp
tabv
ct.cpp tabv
ir.cpp tabxcl.cpp valblk.cpp value.cpp xindex.cpp xobject.cpp
array.h blkfil.h block.h catalog.h checklvl.h colblk.h connect.h csort.h
engmsg.h filamap.h filamdbf.h filamfix.h filamtxt.h filamvct.h filamzip.h
filter.h global.h ha_connect.h inihandl.h json.h maputil.h msgid.h mycat.h
my
util.h os.h osutil.h plgcnx.h plgdbsem.h preparse.h reldef.h resource
.h
tabcol.h tabdos.h tabfix.h tabfmt.h tabjson.h tabmul.h taboccur.h tabpivot
.h
tab
sys.h tabtbl.h tabutil.h tabvct.h tabvir.h tabxcl.h user_connect
.h
valblk.h value.h xindex.h xobject.h xtable.h
)
my
conn.h myutil.h os.h osutil.h plgcnx.h plgdbsem.h preparse.h reldef
.h
resource.h tabcol.h tabdos.h tabfix.h tabfmt.h tabjson.h tabmul.h tabmysql
.h
tab
occur.h tabpivot.h tabsys.h tabtbl.h tabutil.h tabvct.h tabvir.h tabxcl
.h
user_connect.h
valblk.h value.h xindex.h xobject.h xtable.h
)
#
# Definitions that are shared for all OSes
...
...
@@ -166,24 +166,15 @@ IF(LIBXML2_FOUND OR MSXML_FOUND)
ENDIF
()
#
# MySQL
# MySQL
is now included unconditionnally
#
OPTION
(
CONNECT_WITH_MYSQL
"Compile CONNECT storage engine with remote MySQL connection support"
ON
)
IF
(
CONNECT_WITH_MYSQL
)
SET
(
CONNECT_SOURCES
${
CONNECT_SOURCES
}
myconn.cpp myconn.h tabmysql.cpp tabmysql.h
)
add_definitions
(
-DMYSQL_SUPPORT
)
IF
(
NOT UNIX
)
IF
(
NOT UNIX
)
#
# TODO: remove this
# change to use "#include "../../include/mysql.h" in the sources.
INCLUDE_DIRECTORIES
(
"../../include/mysql"
)
ENDIF
(
NOT UNIX
)
ENDIF
(
CONNECT_WITH_MYSQL
)
ENDIF
(
NOT UNIX
)
#
...
...
storage/connect/ha_connect.cc
View file @
464947e6
...
...
@@ -130,10 +130,8 @@
#if defined(ODBC_SUPPORT)
#include "odbccat.h"
#endif // ODBC_SUPPORT
#if defined(MYSQL_SUPPORT)
#include "xtable.h"
#include "tabmysql.h"
#endif // MYSQL_SUPPORT
#include "filamdbf.h"
#include "tabxcl.h"
#include "tabfmt.h"
...
...
@@ -5147,7 +5145,6 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd,
ok
=
true
;
break
;
#if defined(MYSQL_SUPPORT)
case
TAB_MYSQL
:
ok
=
true
;
...
...
@@ -5187,14 +5184,15 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd,
ok
=
false
;
break
;
#endif // MYSQL_SUPPORT
#if defined(WIN32)
case
TAB_WMI
:
ok
=
true
;
break
;
#endif // WIN32
#if defined(PIVOT_SUPPORT)
case
TAB_PIVOT
:
supfnc
=
FNC_NO
;
#endif // PIVOT_SUPPORT
case
TAB_PRX
:
case
TAB_TBL
:
case
TAB_XCL
:
...
...
@@ -5293,12 +5291,10 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd,
break
;
#endif // ODBC_SUPPORT
#if defined(MYSQL_SUPPORT)
case
TAB_MYSQL
:
qrp
=
MyColumns
(
g
,
thd
,
host
,
db
,
user
,
pwd
,
tab
,
NULL
,
port
,
fnc
==
FNC_COL
);
break
;
#endif // MYSQL_SUPPORT
case
TAB_CSV
:
qrp
=
CSVColumns
(
g
,
dpath
,
fn
,
spc
,
qch
,
hdr
,
mxe
,
fnc
==
FNC_COL
);
break
;
...
...
@@ -5324,9 +5320,11 @@ static int connect_assisted_discovery(handlerton *hton, THD* thd,
}
// endif OcrColumns
break
;
#if defined(PIVOT_SUPPORT)
case
TAB_PIVOT
:
qrp
=
PivotColumns
(
g
,
tab
,
src
,
pic
,
fcl
,
skc
,
host
,
db
,
user
,
pwd
,
port
);
break
;
#endif // PIVOT_SUPPORT
case
TAB_VIR
:
qrp
=
VirColumns
(
g
,
tab
,
(
char
*
)
db
,
fnc
==
FNC_COL
);
break
;
...
...
storage/connect/mycat.cc
View file @
464947e6
...
...
@@ -78,9 +78,7 @@
#include "tabxml.h"
#endif // XML_SUPPORT
#include "tabmul.h"
#if defined(MYSQL_SUPPORT)
#include "tabmysql.h"
#endif // MYSQL_SUPPORT
#if defined(ODBC_SUPPORT)
#define NODBC
#include "tabodbc.h"
...
...
@@ -122,10 +120,8 @@ TABTYPE GetTypeID(const char *type)
#ifdef ODBC_SUPPORT
:
(
!
stricmp
(
type
,
"ODBC"
))
?
TAB_ODBC
#endif
#ifdef MYSQL_SUPPORT
:
(
!
stricmp
(
type
,
"MYSQL"
))
?
TAB_MYSQL
:
(
!
stricmp
(
type
,
"MYPRX"
))
?
TAB_MYSQL
#endif
:
(
!
stricmp
(
type
,
"DIR"
))
?
TAB_DIR
#ifdef WIN32
:
(
!
stricmp
(
type
,
"MAC"
))
?
TAB_MAC
...
...
@@ -537,9 +533,7 @@ PRELDEF MYCAT::MakeTableDesc(PGLOBAL g, LPCSTR name, LPCSTR am)
case
TAB_XCL
:
tdp
=
new
(
g
)
XCLDEF
;
break
;
case
TAB_PRX
:
tdp
=
new
(
g
)
PRXDEF
;
break
;
case
TAB_OCCUR
:
tdp
=
new
(
g
)
OCCURDEF
;
break
;
#if defined(MYSQL_SUPPORT)
case
TAB_MYSQL
:
tdp
=
new
(
g
)
MYSQLDEF
;
break
;
#endif // MYSQL_SUPPORT
#if defined(PIVOT_SUPPORT)
case
TAB_PIVOT
:
tdp
=
new
(
g
)
PIVOTDEF
;
break
;
#endif // PIVOT_SUPPORT
...
...
storage/connect/tabjson.cpp
View file @
464947e6
...
...
@@ -1540,12 +1540,11 @@ int TDBJSON::MakeNewDoc(PGLOBAL g)
int
TDBJSON
::
MakeDocument
(
PGLOBAL
g
)
{
char
filename
[
_MAX_PATH
];
int
rc
=
RC_OK
;
DWORD
drc
;
if
(
Done
)
return
RC_OK
;
else
Done
=
true
;
// Now open the JSON file
PlugSetPath
(
filename
,
Txfp
->
To_File
,
GetPath
());
...
...
@@ -1553,16 +1552,11 @@ int TDBJSON::MakeDocument(PGLOBAL g)
/*********************************************************************/
/* Get top of the parsed tree and the inside table document. */
/*********************************************************************/
Top
=
MakeJsonTree
(
g
,
filename
,
Objname
,
Pretty
,
Doc
,
drc
);
if
(
!
Top
)
{
if
(
drc
!=
ENOENT
||
Mode
!=
MODE_INSERT
)
return
RC_FX
;
if
(
!
(
Top
=
MakeJsonTree
(
g
,
filename
,
Objname
,
Pretty
,
Doc
,
drc
)))
rc
=
(
drc
==
ENOENT
&&
Mode
==
MODE_INSERT
)
?
MakeNewDoc
(
g
)
:
RC_FX
;
return
MakeNewDoc
(
g
);
}
// endif !Top
return
RC_OK
;
Done
=
(
rc
==
RC_OK
);
return
rc
;
}
// end of MakeDocument
#if 0
...
...
storage/connect/taboccur.cpp
View file @
464947e6
...
...
@@ -45,9 +45,7 @@
#include "tabcol.h"
#include "taboccur.h"
#include "xtable.h"
#if defined(MYSQL_SUPPORT)
#include "tabmysql.h"
#endif // MYSQL_SUPPORT
#include "ha_connect.h"
#include "mycat.h"
...
...
storage/connect/tabtbl.cpp
View file @
464947e6
...
...
@@ -70,9 +70,7 @@
#include "tabcol.h"
#include "tabdos.h" // TDBDOS and DOSCOL class dcls
#include "tabtbl.h"
#if defined(MYSQL_SUPPORT)
#include "tabmysql.h"
#endif // MYSQL_SUPPORT
#include "ha_connect.h"
#include "mycat.h" // For GetHandler
...
...
storage/connect/tabutil.cpp
View file @
464947e6
...
...
@@ -48,9 +48,7 @@
#include "resource.h"
#include "reldef.h"
#include "xtable.h"
#if defined(MYSQL_SUPPORT)
#include "tabmysql.h"
#endif // MYSQL_SUPPORT
#include "tabcol.h"
#include "tabutil.h"
#include "ha_connect.h"
...
...
@@ -94,19 +92,13 @@ TABLE_SHARE *GetTableShare(PGLOBAL g, THD *thd, const char *db,
if
(
!
open_table_def
(
thd
,
s
,
GTS_TABLE
|
GTS_VIEW
))
{
if
(
!
s
->
is_view
)
{
if
(
stricmp
(
plugin_name
(
s
->
db_plugin
)
->
str
,
"connect"
))
{
#if defined(MYSQL_SUPPORT)
if
(
stricmp
(
plugin_name
(
s
->
db_plugin
)
->
str
,
"connect"
))
mysql
=
true
;
#else // !MYSQL_SUPPORT
sprintf
(
g
->
Message
,
"%s.%s is not a CONNECT table"
,
db
,
name
);
return
NULL
;
#endif // MYSQL_SUPPORT
}
else
else
mysql
=
false
;
}
else
{
}
else
mysql
=
true
;
}
// endif is_view
}
else
{
if
(
thd
->
is_error
())
...
...
@@ -428,7 +420,6 @@ PTDBASE TDBPRX::GetSubTable(PGLOBAL g, PTABLE tabp, bool b)
}
// endif srcdef
if
(
mysql
)
{
#if defined(MYSQL_SUPPORT)
// Access sub-table via MySQL API
if
(
!
(
tdbp
=
cat
->
GetTable
(
g
,
tabp
,
Mode
,
"MYPRX"
)))
{
char
buf
[
MAX_STR
];
...
...
@@ -445,11 +436,6 @@ PTDBASE TDBPRX::GetSubTable(PGLOBAL g, PTABLE tabp, bool b)
if
(
Mode
==
MODE_UPDATE
||
Mode
==
MODE_DELETE
)
tdbp
->
SetName
(
Name
);
// For Make_Command
#else // !MYSQL_SUPPORT
sprintf
(
g
->
Message
,
"%s.%s is not a CONNECT table"
,
db
,
tblp
->
Name
);
goto
err
;
#endif // MYSQL_SUPPORT
}
else
{
// Sub-table is a CONNECT table
tabp
->
Next
=
To_Table
;
// For loop checking
...
...
storage/connect/tabxcl.cpp
View file @
464947e6
...
...
@@ -51,9 +51,7 @@
#include "tabcol.h"
#include "tabxcl.h"
#include "xtable.h"
#if defined(MYSQL_SUPPORT)
#include "tabmysql.h"
#endif // MYSQL_SUPPORT
#include "ha_connect.h"
#include "mycat.h"
...
...
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