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
4af516c4
Commit
4af516c4
authored
5 years ago
by
Alexey Botchkov
Committed by
Sergei Golubchik
5 months ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
json_get_object_nkey() function implemented.
parent
c88cb0b7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
1 deletion
+37
-1
strings/json_lib.c
strings/json_lib.c
+37
-1
No files found.
strings/json_lib.c
View file @
4af516c4
...
...
@@ -2021,7 +2021,43 @@ enum json_types json_get_object_nkey(const char *js __attribute__((unused)),
const
char
**
value
__attribute__
((
unused
)),
int
*
value_len
__attribute__
((
unused
)))
{
json_engine_t
je
;
int
keys_found
=
0
;
json_scan_start
(
&
je
,
&
my_charset_utf8mb4_bin
,(
const
uchar
*
)
js
,
(
const
uchar
*
)
js_end
);
if
(
json_read_value
(
&
je
)
||
je
.
value_type
!=
JSON_VALUE_OBJECT
)
goto
err_return
;
while
(
!
json_scan_next
(
&
je
))
{
switch
(
je
.
state
)
{
case
JST_KEY
:
if
(
nkey
==
keys_found
)
{
*
keyname
=
(
char
*
)
je
.
s
.
c_str
;
while
(
json_read_keyname_chr
(
&
je
)
==
0
)
*
keyname_end
=
(
char
*
)
je
.
s
.
c_str
;
return
smart_read_value
(
&
je
,
value
,
value_len
);
}
keys_found
++
;
if
(
json_skip_key
(
&
je
))
goto
err_return
;
break
;
case
JST_OBJ_END
:
return
JSV_NOTHING
;
}
}
err_return:
return
JSV_BAD_JSON
;
}
...
...
This diff is collapsed.
Click to expand it.
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