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
df87dce0
Commit
df87dce0
authored
Dec 05, 2016
by
Alexey Botchkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-11473 JSON_REMOVE returns invalid results.
Item_func_json_remove::val_str fixed.
parent
7e03c67a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
4 deletions
+2
-4
mysql-test/r/func_json.result
mysql-test/r/func_json.result
+1
-1
sql/item_jsonfunc.cc
sql/item_jsonfunc.cc
+1
-3
No files found.
mysql-test/r/func_json.result
View file @
df87dce0
...
...
@@ -150,7 +150,7 @@ json_remove(@j, '$[0]')
[ ["b", "c"], "d"]
select json_remove(@j, '$[1]');
json_remove(@j, '$[1]')
["a" "d"]
["a"
,
"d"]
select json_remove(@j, '$[2]');
json_remove(@j, '$[2]')
["a", ["b", "c"]]
...
...
sql/item_jsonfunc.cc
View file @
df87dce0
...
...
@@ -1667,9 +1667,7 @@ String *Item_func_json_remove::val_str(String *str)
rem_start
=
(
const
char
*
)
(
je
.
s
.
c_str
-
je
.
sav_c_len
);
json_string_set_str
(
&
key_name
,
lp
->
key
,
lp
->
key_end
);
if
(
json_key_matches
(
&
je
,
&
key_name
))
{
goto
v_found
;
}
if
(
json_skip_key
(
&
je
))
goto
error
;
...
...
@@ -1693,7 +1691,7 @@ String *Item_func_json_remove::val_str(String *str)
if
(
json_skip_key
(
&
je
)
||
json_scan_next
(
&
je
))
goto
error
;
rem_end
=
(
je
.
state
==
JST_VALUE
)
?
rem_end
=
(
je
.
state
==
JST_VALUE
&&
n_item
==
0
)
?
(
const
char
*
)
je
.
s
.
c_str
:
(
const
char
*
)
(
je
.
s
.
c_str
-
je
.
sav_c_len
);
str
->
length
(
0
);
...
...
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