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
24c18ce8
Commit
24c18ce8
authored
Dec 18, 2020
by
Olivier Bertrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fix json parser (void objects not recognized) modified: json.cpp
parent
a7867410
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
12 deletions
+15
-12
storage/connect/ha_connect.cc
storage/connect/ha_connect.cc
+13
-10
storage/connect/json.cpp
storage/connect/json.cpp
+2
-2
No files found.
storage/connect/ha_connect.cc
View file @
24c18ce8
...
@@ -170,7 +170,7 @@
...
@@ -170,7 +170,7 @@
#define JSONMAX 10 // JSON Default max grp size
#define JSONMAX 10 // JSON Default max grp size
extern
"C"
{
extern
"C"
{
char
version
[]
=
"Version 1.07.0002 December 1
2
, 2020"
;
char
version
[]
=
"Version 1.07.0002 December 1
8
, 2020"
;
#if defined(__WIN__)
#if defined(__WIN__)
char
compver
[]
=
"Version 1.07.0002 "
__DATE__
" "
__TIME__
;
char
compver
[]
=
"Version 1.07.0002 "
__DATE__
" "
__TIME__
;
char
slash
=
'\\'
;
char
slash
=
'\\'
;
...
@@ -1070,12 +1070,12 @@ static PGLOBAL GetPlug(THD *thd, PCONNECT& lxp)
...
@@ -1070,12 +1070,12 @@ static PGLOBAL GetPlug(THD *thd, PCONNECT& lxp)
/****************************************************************************/
/****************************************************************************/
TABTYPE
ha_connect
::
GetRealType
(
PTOS
pos
)
TABTYPE
ha_connect
::
GetRealType
(
PTOS
pos
)
{
{
TABTYPE
type
;
TABTYPE
type
=
TAB_UNDEF
;
if
(
pos
||
(
pos
=
GetTableOptionStruct
()))
{
if
(
pos
||
(
pos
=
GetTableOptionStruct
()))
{
type
=
GetTypeID
(
pos
->
type
);
type
=
GetTypeID
(
pos
->
type
);
if
(
type
==
TAB_UNDEF
)
if
(
type
==
TAB_UNDEF
&&
!
pos
->
http
)
type
=
pos
->
srcdef
?
TAB_MYSQL
:
pos
->
tabname
?
TAB_PRX
:
TAB_DOS
;
type
=
pos
->
srcdef
?
TAB_MYSQL
:
pos
->
tabname
?
TAB_PRX
:
TAB_DOS
;
#if defined(REST_SUPPORT)
#if defined(REST_SUPPORT)
else
if
(
pos
->
http
)
else
if
(
pos
->
http
)
...
@@ -1083,7 +1083,8 @@ TABTYPE ha_connect::GetRealType(PTOS pos)
...
@@ -1083,7 +1083,8 @@ TABTYPE ha_connect::GetRealType(PTOS pos)
case
TAB_JSON
:
case
TAB_JSON
:
case
TAB_XML
:
case
TAB_XML
:
case
TAB_CSV
:
case
TAB_CSV
:
type
=
TAB_REST
;
case
TAB_UNDEF
:
type
=
TAB_REST
;
break
;
break
;
case
TAB_REST
:
case
TAB_REST
:
type
=
TAB_NIY
;
type
=
TAB_NIY
;
...
@@ -1093,8 +1094,7 @@ TABTYPE ha_connect::GetRealType(PTOS pos)
...
@@ -1093,8 +1094,7 @@ TABTYPE ha_connect::GetRealType(PTOS pos)
}
// endswitch type
}
// endswitch type
#endif // REST_SUPPORT
#endif // REST_SUPPORT
}
else
}
// endif pos
type
=
TAB_UNDEF
;
return
type
;
return
type
;
}
// end of GetRealType
}
// end of GetRealType
...
@@ -5690,7 +5690,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
...
@@ -5690,7 +5690,7 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
try
{
try
{
// Check table type
// Check table type
if
(
ttp
==
TAB_UNDEF
)
{
if
(
ttp
==
TAB_UNDEF
&&
!
topt
->
http
)
{
topt
->
type
=
(
src
)
?
"MYSQL"
:
(
tab
)
?
"PROXY"
:
"DOS"
;
topt
->
type
=
(
src
)
?
"MYSQL"
:
(
tab
)
?
"PROXY"
:
"DOS"
;
ttp
=
GetTypeID
(
topt
->
type
);
ttp
=
GetTypeID
(
topt
->
type
);
sprintf
(
g
->
Message
,
"No table_type. Was set to %s"
,
topt
->
type
);
sprintf
(
g
->
Message
,
"No table_type. Was set to %s"
,
topt
->
type
);
...
@@ -5708,7 +5708,8 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
...
@@ -5708,7 +5708,8 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
#endif // BSON_SUPPORT
#endif // BSON_SUPPORT
case
TAB_XML
:
case
TAB_XML
:
case
TAB_CSV
:
case
TAB_CSV
:
ttp
=
TAB_REST
;
case
TAB_UNDEF
:
ttp
=
TAB_REST
;
break
;
break
;
default:
default:
break
;
break
;
...
@@ -6131,8 +6132,10 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
...
@@ -6131,8 +6132,10 @@ static int connect_assisted_discovery(handlerton *, THD* thd,
}
// endif !nblin
}
// endif !nblin
// Restore language type
// Restore language type
if
(
ttp
==
TAB_REST
)
if
(
ttp
==
TAB_REST
)
{
ttp
=
GetTypeID
(
topt
->
type
);
ttp
=
GetTypeID
(
topt
->
type
);
ttp
=
(
ttp
==
TAB_UNDEF
)
?
TAB_JSON
:
ttp
;
}
// endif ttp
for
(
i
=
0
;
!
rc
&&
i
<
qrp
->
Nblin
;
i
++
)
{
for
(
i
=
0
;
!
rc
&&
i
<
qrp
->
Nblin
;
i
++
)
{
typ
=
len
=
prec
=
dec
=
flg
=
0
;
typ
=
len
=
prec
=
dec
=
flg
=
0
;
...
...
storage/connect/json.cpp
View file @
24c18ce8
...
@@ -554,7 +554,7 @@ PJAR JDOC::ParseArray(PGLOBAL g, int& i)
...
@@ -554,7 +554,7 @@ PJAR JDOC::ParseArray(PGLOBAL g, int& i)
PJOB
JDOC
::
ParseObject
(
PGLOBAL
g
,
int
&
i
)
PJOB
JDOC
::
ParseObject
(
PGLOBAL
g
,
int
&
i
)
{
{
PSZ
key
;
PSZ
key
;
int
level
=
0
;
int
level
=
-
1
;
PJOB
jobp
=
new
(
g
)
JOBJECT
;
PJOB
jobp
=
new
(
g
)
JOBJECT
;
PJPR
jpp
=
NULL
;
PJPR
jpp
=
NULL
;
...
@@ -590,7 +590,7 @@ PJOB JDOC::ParseObject(PGLOBAL g, int& i)
...
@@ -590,7 +590,7 @@ PJOB JDOC::ParseObject(PGLOBAL g, int& i)
break
;
break
;
case
'}'
:
case
'}'
:
if
(
level
<
2
)
{
if
(
level
==
0
||
level
==
1
)
{
sprintf
(
g
->
Message
,
"Unexpected '}' near %.*s"
,
ARGS
);
sprintf
(
g
->
Message
,
"Unexpected '}' near %.*s"
,
ARGS
);
throw
2
;
throw
2
;
}
// endif level
}
// endif level
...
...
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