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
2b014616
Commit
2b014616
authored
Dec 05, 2016
by
Alexey Botchkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-11465 JSON_LENGTH returns incorrect length.
Item_func_json_length::val_int fixed.
parent
75a51818
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
mysql-test/r/func_json.result
mysql-test/r/func_json.result
+9
-0
mysql-test/t/func_json.test
mysql-test/t/func_json.test
+3
-0
sql/item_jsonfunc.cc
sql/item_jsonfunc.cc
+1
-2
No files found.
mysql-test/r/func_json.result
View file @
2b014616
...
@@ -292,3 +292,12 @@ json_depth('[[], {}]')
...
@@ -292,3 +292,12 @@ json_depth('[[], {}]')
select json_depth('[[[1,2,3],"s"], {}, []]');
select json_depth('[[[1,2,3],"s"], {}, []]');
json_depth('[[[1,2,3],"s"], {}, []]')
json_depth('[[[1,2,3],"s"], {}, []]')
4
4
select json_length('');
json_length('')
NULL
select json_length('{}');
json_length('{}')
0
select json_length('[1, 2, {"a": 3}]');
json_length('[1, 2, {"a": 3}]')
3
mysql-test/t/func_json.test
View file @
2b014616
...
@@ -129,3 +129,6 @@ select json_depth(cast(NULL as JSON));
...
@@ -129,3 +129,6 @@ select json_depth(cast(NULL as JSON));
select
json_depth
(
'[[], {}]'
);
select
json_depth
(
'[[], {}]'
);
select
json_depth
(
'[[[1,2,3],"s"], {}, []]'
);
select
json_depth
(
'[[[1,2,3],"s"], {}, []]'
);
select
json_length
(
''
);
select
json_length
(
'{}'
);
select
json_length
(
'[1, 2, {"a": 3}]'
);
sql/item_jsonfunc.cc
View file @
2b014616
...
@@ -1271,8 +1271,7 @@ longlong Item_func_json_length::val_int()
...
@@ -1271,8 +1271,7 @@ longlong Item_func_json_length::val_int()
return
0
;
return
0
;
}
}
return
length
;
return
length
-
1
;
}
}
...
...
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