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
ce55094f
Commit
ce55094f
authored
Dec 16, 2016
by
Alexey Botchkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-11572 JSON_DEPTH returns wrong results.
JSON depth calculation fixed.
parent
30c231b0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
0 deletions
+5
-0
mysql-test/r/func_json.result
mysql-test/r/func_json.result
+3
-0
mysql-test/t/func_json.test
mysql-test/t/func_json.test
+1
-0
sql/item_jsonfunc.cc
sql/item_jsonfunc.cc
+1
-0
No files found.
mysql-test/r/func_json.result
View file @
ce55094f
...
...
@@ -405,6 +405,9 @@ json_depth('[[], {}]')
select json_depth('[[[1,2,3],"s"], {}, []]');
json_depth('[[[1,2,3],"s"], {}, []]')
4
select json_depth('[10, {"a": 20}]');
json_depth('[10, {"a": 20}]')
3
select json_length('');
json_length('')
NULL
...
...
mysql-test/t/func_json.test
View file @
ce55094f
...
...
@@ -163,6 +163,7 @@ select cast(NULL AS JSON);
select
json_depth
(
cast
(
NULL
as
JSON
));
select
json_depth
(
'[[], {}]'
);
select
json_depth
(
'[[[1,2,3],"s"], {}, []]'
);
select
json_depth
(
'[10, {"a": 20}]'
);
select
json_length
(
''
);
select
json_length
(
'{}'
);
...
...
sql/item_jsonfunc.cc
View file @
ce55094f
...
...
@@ -1624,6 +1624,7 @@ longlong Item_func_json_depth::val_int()
switch
(
je
.
state
)
{
case
JST_VALUE
:
case
JST_KEY
:
if
(
inc_depth
)
{
c_depth
++
;
...
...
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