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
6dda9e04
Commit
6dda9e04
authored
May 01, 2015
by
Olivier Bertrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Same as last 10.0 commit
parent
b3f9838f
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
57 additions
and
60 deletions
+57
-60
storage/connect/global.h
storage/connect/global.h
+1
-1
storage/connect/ha_connect.cc
storage/connect/ha_connect.cc
+24
-38
storage/connect/mysql-test/connect/r/json.result
storage/connect/mysql-test/connect/r/json.result
+6
-6
storage/connect/tabjson.cpp
storage/connect/tabjson.cpp
+18
-3
storage/connect/tabjson.h
storage/connect/tabjson.h
+2
-1
storage/connect/tabmul.cpp
storage/connect/tabmul.cpp
+4
-2
storage/connect/tabtbl.cpp
storage/connect/tabtbl.cpp
+1
-1
storage/connect/tabutil.cpp
storage/connect/tabutil.cpp
+0
-7
storage/connect/value.cpp
storage/connect/value.cpp
+1
-1
No files found.
storage/connect/global.h
View file @
6dda9e04
...
...
@@ -118,7 +118,7 @@ extern "C" {
/* Static variables */
/***********************************************************************/
#if defined(STORAGE)
char
sys_stamp
[
4
]
=
SYS_STAMP
;
char
sys_stamp
[
5
]
=
SYS_STAMP
;
#else
extern
char
sys_stamp
[];
#endif
...
...
storage/connect/ha_connect.cc
View file @
6dda9e04
...
...
@@ -168,35 +168,21 @@
#define JSONMAX 10 // JSON Default max grp size
extern
"C"
{
char
version
[]
=
"Version 1.03.0006 April 12, 2015"
;
char
version
[]
=
"Version 1.03.0007 April 30, 2015"
;
#if defined(WIN32)
char
compver
[]
=
"Version 1.03.000
6
"
__DATE__
" "
__TIME__
;
char
compver
[]
=
"Version 1.03.000
7
"
__DATE__
" "
__TIME__
;
char
slash
=
'\\'
;
#else // !WIN32
char
slash
=
'/'
;
#endif // !WIN32
// int trace= 0; // The general trace value
// ulong xconv= 0; // The type conversion option
// int zconv= 0; // The text conversion size
}
// extern "C"
#if defined(XMAP)
my_bool
xmap
=
false
;
#endif // XMAP
// uint worksize= 0;
ulong
ha_connect
::
num
=
0
;
//int DTVAL::Shift= 0;
/* CONNECT system variables */
//atic int conv_size= 0;
//atic uint work_size= 0;
//atic ulong type_conv= 0;
#if defined(XMAP)
//atic my_bool indx_map= 0;
#endif // XMAP
#if defined(XMSG)
extern
"C"
{
char
*
msg_path
;
...
...
@@ -613,9 +599,9 @@ DllExport LPCSTR PlugSetPath(LPSTR to, LPCSTR name, LPCSTR dir)
delete_table method in handler.cc
*/
static
const
char
*
ha_connect_exts
[]
=
{
".dos"
,
".fix"
,
".csv"
,
".bin"
,
".fmt"
,
".dbf"
,
".xml"
,
".
ini"
,
".vec
"
,
".
dnx"
,
".fnx"
,
".bnx"
,
".vnx"
,
".dbx"
,
".dop"
,
".fop"
,
".bop"
,
".v
op"
,
NULL
};
".dos"
,
".fix"
,
".csv"
,
".bin"
,
".fmt"
,
".dbf"
,
".xml"
,
".
json"
,
".ini
"
,
".
vec"
,
".dnx"
,
".fnx"
,
".bnx"
,
".vnx"
,
".dbx"
,
".dop"
,
".fop"
,
".b
op"
,
".vop"
,
NULL
};
/**
@brief
...
...
@@ -4730,6 +4716,25 @@ ha_rows ha_connect::records_in_range(uint inx, key_range *min_key,
DBUG_RETURN
(
rows
);
}
// end of records_in_range
// Used to check whether a MYSQL table is created on itself
bool
CheckSelf
(
PGLOBAL
g
,
TABLE_SHARE
*
s
,
const
char
*
host
,
const
char
*
db
,
char
*
tab
,
const
char
*
src
,
int
port
)
{
if
(
src
)
return
false
;
else
if
(
host
&&
stricmp
(
host
,
"localhost"
)
&&
strcmp
(
host
,
"127.0.0.1"
))
return
false
;
else
if
(
db
&&
stricmp
(
db
,
s
->
db
.
str
))
return
false
;
else
if
(
tab
&&
stricmp
(
tab
,
s
->
table_name
.
str
))
return
false
;
else
if
(
port
&&
port
!=
(
signed
)
GetDefaultPort
())
return
false
;
strcpy
(
g
->
Message
,
"This MySQL table is defined on itself"
);
return
true
;
}
// end of CheckSelf
/**
Convert an ISO-8859-1 column name to UTF-8
*/
...
...
@@ -4933,25 +4938,6 @@ static int init_table_share(THD* thd,
sql
->
ptr
(),
sql
->
length
());
}
// end of init_table_share
// Used to check whether a MYSQL table is created on itself
bool
CheckSelf
(
PGLOBAL
g
,
TABLE_SHARE
*
s
,
const
char
*
host
,
const
char
*
db
,
char
*
tab
,
const
char
*
src
,
int
port
)
{
if
(
src
)
return
false
;
else
if
(
host
&&
stricmp
(
host
,
"localhost"
)
&&
strcmp
(
host
,
"127.0.0.1"
))
return
false
;
else
if
(
db
&&
stricmp
(
db
,
s
->
db
.
str
))
return
false
;
else
if
(
tab
&&
stricmp
(
tab
,
s
->
table_name
.
str
))
return
false
;
else
if
(
port
&&
port
!=
(
signed
)
GetDefaultPort
())
return
false
;
strcpy
(
g
->
Message
,
"This MySQL table is defined on itself"
);
return
true
;
}
// end of CheckSelf
/**
@brief
connect_assisted_discovery() is called when creating a table with no columns.
...
...
storage/connect/mysql-test/connect/r/json.result
View file @
6dda9e04
...
...
@@ -89,8 +89,8 @@ ISBN Language Subject AuthorFN AuthorLN Title Translation Translator Publisher L
UPDATE t1 SET AuthorFN = 'Philippe' WHERE AuthorLN = 'Knab';
SELECT * FROM t1 WHERE ISBN = '9782212090819';
ISBN Language Subject AuthorFN AuthorLN Title Translation Translator Publisher Location Year
9782212090819 fr applications
Philipp
e Bernadac Construire une application XML NULL NULL Eyrolles Paris 1999
9782212090819 fr applications
Franois
Knab Construire une application XML NULL NULL Eyrolles Paris 1999
9782212090819 fr applications
Jean-Christoph
e Bernadac Construire une application XML NULL NULL Eyrolles Paris 1999
9782212090819 fr applications
Philippe
Knab Construire une application XML NULL NULL Eyrolles Paris 1999
#
# To add an author a new table must be created
#
...
...
@@ -104,8 +104,8 @@ William J. Pardi
INSERT INTO t2 VALUES('Charles','Dickens');
SELECT * FROM t1;
ISBN Language Subject AuthorFN AuthorLN Title Translation Translator Publisher Location Year
9782212090819 fr applications
Philipp
e Bernadac Construire une application XML NULL NULL Eyrolles Paris 1999
9782212090819 fr applications
Franois
Knab Construire une application XML NULL NULL Eyrolles Paris 1999
9782212090819 fr applications
Jean-Christoph
e Bernadac Construire une application XML NULL NULL Eyrolles Paris 1999
9782212090819 fr applications
Philippe
Knab Construire une application XML NULL NULL Eyrolles Paris 1999
9782840825685 fr applications William J. Pardi XML en Action adapt de l'anglais par James Guerin Microsoft Press Paris 1999
9782840825685 fr applications Charles Dickens XML en Action adapt de l'anglais par James Guerin Microsoft Press Paris 1999
DROP TABLE t1;
...
...
@@ -127,11 +127,11 @@ line
"SUBJECT": "applications",
"AUTHOR": [
{
"FIRSTNAME": "
Philipp
e",
"FIRSTNAME": "
Jean-Christoph
e",
"LASTNAME": "Bernadac"
},
{
"FIRSTNAME": "
Franois"
,
"FIRSTNAME": "
Philippe
",
"LASTNAME": "Knab"
}
],
...
...
storage/connect/tabjson.cpp
View file @
6dda9e04
...
...
@@ -968,6 +968,20 @@ bool JSONCOL::ParseJpath(PGLOBAL g)
else
if
(
!
Jpath
)
Jpath
=
Name
;
if
(
To_Tdb
->
GetOrig
())
{
// This is an updated column, get nodes from origin
for
(
PJCOL
colp
=
(
PJCOL
)
Tjp
->
GetColumns
();
colp
;
colp
=
(
PJCOL
)
colp
->
GetNext
())
if
(
!
stricmp
(
Name
,
colp
->
GetName
()))
{
Nod
=
colp
->
Nod
;
Nodes
=
colp
->
Nodes
;
goto
fin
;
}
// endif Name
sprintf
(
g
->
Message
,
"Cannot parse updated column %s"
,
Name
);
return
true
;
}
// endif To_Orig
pbuf
=
PlugDup
(
g
,
Jpath
);
// The Jpath must be analyzed
...
...
@@ -998,6 +1012,7 @@ bool JSONCOL::ParseJpath(PGLOBAL g)
}
// endfor i, p
fin:
MulVal
=
AllocateValue
(
g
,
Value
);
Parsed
=
true
;
return
false
;
...
...
@@ -1147,7 +1162,7 @@ PVAL JSONCOL::ExpandArray(PGLOBAL g, PJAR arp, int n)
ars
=
MY_MIN
(
Tjp
->
Limit
,
arp
->
size
());
if
(
!
(
jvp
=
arp
->
GetValue
(
Nodes
[
n
].
Nx
)))
{
if
(
!
(
jvp
=
arp
->
GetValue
(
(
Nodes
[
n
].
Rx
=
Nodes
[
n
].
Nx
)
)))
{
strcpy
(
g
->
Message
,
"Logical error expanding array"
);
longjmp
(
g
->
jumper
[
g
->
jump_level
],
666
);
}
// endif jvp
...
...
@@ -1278,7 +1293,7 @@ PJSON JSONCOL::GetRow(PGLOBAL g)
if
(
Nodes
[
i
].
Rank
)
val
=
arp
->
GetValue
(
Nodes
[
i
].
Rank
-
1
);
else
val
=
arp
->
GetValue
(
Nodes
[
i
].
N
x
);
val
=
arp
->
GetValue
(
Nodes
[
i
].
R
x
);
}
else
val
=
NULL
;
...
...
storage/connect/tabjson.h
View file @
6dda9e04
...
...
@@ -25,7 +25,8 @@ typedef struct _jnode {
PVAL
CncVal
;
// To cont value used for OP_CNC
PVAL
Valp
;
// The internal array VALUE
int
Rank
;
// The rank in array
int
Nx
;
// Same row number
int
Rx
;
// Read row number
int
Nx
;
// Next to read row number
}
JNODE
,
*
PJNODE
;
/***********************************************************************/
...
...
storage/connect/tabmul.cpp
View file @
6dda9e04
...
...
@@ -171,8 +171,10 @@ bool TDBMUL::InitFileNames(PGLOBAL g)
}
// endif hSearch
while
(
n
<
PFNZ
)
{
if
(
!
(
FileData
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
))
{
strcat
(
strcat
(
strcpy
(
filename
,
drive
),
direc
),
FileData
.
cFileName
);
pfn
[
n
++
]
=
PlugDup
(
g
,
filename
);
}
// endif dwFileAttributes
if
(
!
FindNextFile
(
hSearch
,
&
FileData
))
{
rc
=
GetLastError
();
...
...
storage/connect/tabtbl.cpp
View file @
6dda9e04
...
...
@@ -5,7 +5,7 @@
/* */
/* COPYRIGHT: */
/* ---------- */
/* (C) Copyright to PlugDB Software Development 2008-201
4
*/
/* (C) Copyright to PlugDB Software Development 2008-201
5
*/
/* Author: Olivier BERTRAND */
/* */
/* WHAT THIS PROGRAM DOES: */
...
...
storage/connect/tabutil.cpp
View file @
6dda9e04
...
...
@@ -52,7 +52,6 @@
#include "tabutil.h"
#include "ha_connect.h"
//extern "C" int zconv;
int
GetConvSize
(
void
);
/************************************************************************/
...
...
@@ -72,11 +71,8 @@ TABLE_SHARE *GetTableShare(PGLOBAL g, THD *thd, const char *db,
{
char
key
[
256
];
uint
k
;
//TABLE_LIST table_list;
TABLE_SHARE
*
s
;
//table_list.init_one_table(db, strlen(db), name, strlen(name),
// NULL, TL_IGNORE);
k
=
sprintf
(
key
,
"%s"
,
db
)
+
1
;
k
+=
sprintf
(
key
+
k
,
"%s"
,
name
);
key
[
++
k
]
=
0
;
...
...
@@ -86,9 +82,6 @@ TABLE_SHARE *GetTableShare(PGLOBAL g, THD *thd, const char *db,
return
NULL
;
}
// endif s
// 1 2 4 8
//flags = GTS_TABLE | GTS_VIEW | GTS_NOLOCK | GTS_FORCE_DISCOVERY;
if
(
!
open_table_def
(
thd
,
s
,
GTS_TABLE
|
GTS_VIEW
))
{
if
(
!
s
->
is_view
)
{
if
(
stricmp
(
plugin_name
(
s
->
db_plugin
)
->
str
,
"connect"
))
...
...
storage/connect/value.cpp
View file @
6dda9e04
/************* Value C++ Functions Source Code File (.CPP) *************/
/* Name: VALUE.CPP Version 2.5 */
/* */
/* (C) Copyright to the author Olivier BERTRAND 2001-201
4
*/
/* (C) Copyright to the author Olivier BERTRAND 2001-201
5
*/
/* */
/* This file contains the VALUE and derived classes family functions. */
/* These classes contain values of different types. They are used so */
...
...
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