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
a8467e2f
Commit
a8467e2f
authored
Dec 03, 2016
by
Alexey Botchkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-11449 Server crashes in Item_func_or_sum::agg_item_collations.
JSON_ARRAY didn't expect 0 arguments.
parent
eca15790
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
0 deletions
+16
-0
mysql-test/r/func_json.result
mysql-test/r/func_json.result
+6
-0
mysql-test/t/func_json.test
mysql-test/t/func_json.test
+2
-0
sql/item_jsonfunc.cc
sql/item_jsonfunc.cc
+8
-0
No files found.
mysql-test/r/func_json.result
View file @
a8467e2f
...
...
@@ -34,6 +34,9 @@ NULL
select json_query('{"key1":123, "key1": [1,2,3]}', '$.key1');
json_query('{"key1":123, "key1": [1,2,3]}', '$.key1')
[1,2,3]
select json_array();
json_array()
[]
select json_array(1);
json_array(1)
[1]
...
...
@@ -150,6 +153,9 @@ json_remove(@j, '$.b')
select json_remove(@j, '$.a');
json_remove(@j, '$.a')
{"b": [2, 3]}
select json_object();
json_object()
{}
select json_object("ki", 1, "mi", "ya");
json_object("ki", 1, "mi", "ya")
{"ki": 1, "mi": "ya"}
...
...
mysql-test/t/func_json.test
View file @
a8467e2f
...
...
@@ -13,6 +13,7 @@ select json_query('{"key1":{"a":1, "b":[1,2]}}', '$.key1');
select
json_query
(
'{"key1": 1}'
,
'$.key1'
);
select
json_query
(
'{"key1":123, "key1": [1,2,3]}'
,
'$.key1'
);
select
json_array
();
select
json_array
(
1
);
select
json_array
(
1
,
"text"
,
false
,
null
);
...
...
@@ -63,6 +64,7 @@ set @j = '{"a": 1, "b": [2, 3]}';
select
json_remove
(
@
j
,
'$.b'
);
select
json_remove
(
@
j
,
'$.a'
);
select
json_object
();
select
json_object
(
"ki"
,
1
,
"mi"
,
"ya"
);
select
json_exists
(
'{"key1":"xxxx", "key2":[1, 2, 3]}'
,
"$.key2"
);
...
...
sql/item_jsonfunc.cc
View file @
a8467e2f
...
...
@@ -877,6 +877,14 @@ void Item_func_json_array::fix_length_and_dec()
ulonglong
char_length
=
4
;
uint
n_arg
;
if
(
arg_count
==
0
)
{
collation
.
set
(
&
my_charset_utf8_general_ci
);
tmp_val
.
set_charset
(
&
my_charset_utf8_general_ci
);
max_length
=
2
;
return
;
}
if
(
agg_arg_charsets_for_string_result
(
collation
,
args
,
arg_count
))
return
;
...
...
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