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
80a38372
Commit
80a38372
authored
Sep 12, 2017
by
Alexey Botchkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-12877 Wrong result from JSON native function.
JSON_QUOTE return type set to be JSON.
parent
825c8d79
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
0 deletions
+9
-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
+5
-0
sql/item_jsonfunc.h
sql/item_jsonfunc.h
+1
-0
No files found.
mysql-test/r/func_json.result
View file @
80a38372
...
...
@@ -696,3 +696,6 @@ SET @path = "$.\"\\u00e4\"";
select @str, @path, JSON_EXTRACT(@str, @path);
@str @path JSON_EXTRACT(@str, @path)
{"\u00e4":"yes"} $."\u00e4" "yes"
select json_array(5,json_query('[1,2]','$'));
json_array(5,json_query('[1,2]','$'))
[5, [1,2]]
mysql-test/t/func_json.test
View file @
80a38372
...
...
@@ -349,3 +349,8 @@ SET @str = "{\"\\u00e4\":\"yes\"}";
SET
@
path
=
"$.
\"\\
u00e4
\"
"
;
select
@
str
,
@
path
,
JSON_EXTRACT
(
@
str
,
@
path
);
#
# MDEV-12877 Wrong result from JSON native function.
#
select
json_array
(
5
,
json_query
(
'[1,2]'
,
'$'
));
sql/item_jsonfunc.h
View file @
80a38372
...
...
@@ -101,6 +101,7 @@ class Item_func_json_query: public Item_func_json_value
public:
Item_func_json_query
(
THD
*
thd
,
Item
*
js
,
Item
*
i_path
)
:
Item_func_json_value
(
thd
,
js
,
i_path
)
{}
bool
is_json_type
()
{
return
true
;
}
const
char
*
func_name
()
const
{
return
"json_query"
;
}
bool
check_and_get_value
(
json_engine_t
*
je
,
String
*
res
,
int
*
error
);
Item
*
get_copy
(
THD
*
thd
,
MEM_ROOT
*
mem_root
)
...
...
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