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
8bbf6697
Commit
8bbf6697
authored
Nov 02, 2023
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-24784 JSON_ARRAYAGG charset issue
set the proper charset for a temporary result
parent
9a545eb6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
1 deletion
+29
-1
mysql-test/main/func_json.result
mysql-test/main/func_json.result
+11
-0
mysql-test/main/func_json.test
mysql-test/main/func_json.test
+10
-1
sql/item_jsonfunc.cc
sql/item_jsonfunc.cc
+7
-0
sql/item_jsonfunc.h
sql/item_jsonfunc.h
+1
-0
No files found.
mysql-test/main/func_json.result
View file @
8bbf6697
...
...
@@ -1646,5 +1646,16 @@ SELECT JSON_OBJECTAGG('\\', 1);
JSON_OBJECTAGG('\\', 1)
{"\\":1}
#
# MDEV-24784 JSON_ARRAYAGG charset issue
#
set names utf8;
select json_arrayagg('ä'), json_objectagg(1, 'ä');
json_arrayagg('ä') json_objectagg(1, 'ä')
["ä"] {"1":"ä"}
set names latin1;
select json_arrayagg('ä'), json_objectagg(1, 'ä');
json_arrayagg('ä') json_objectagg(1, 'ä')
["ä"] {"1":"ä"}
#
# End of 10.5 tests
#
mysql-test/main/func_json.test
View file @
8bbf6697
...
...
@@ -1109,6 +1109,15 @@ SELECT JSON_OBJECTAGG('\"', 1);
SELECT
JSON_OBJECTAGG
(
'\\'
,
1
);
--
echo
#
--
echo
#
End of 10.5 tests
--
echo
#
MDEV-24784 JSON_ARRAYAGG charset issue
--
echo
#
--
disable_service_connection
set
names
utf8
;
select
json_arrayagg
(
'ä'
),
json_objectagg
(
1
,
'ä'
);
set
names
latin1
;
select
json_arrayagg
(
'ä'
),
json_objectagg
(
1
,
'ä'
);
--
enable_service_connection
--
echo
#
--
echo
# End of 10.5 tests
--
echo
#
sql/item_jsonfunc.cc
View file @
8bbf6697
...
...
@@ -3907,6 +3907,13 @@ int Arg_comparator::compare_e_json_str_basic(Item *j, Item *s)
return
MY_TEST
(
sortcmp
(
res1
,
res2
,
compare_collation
())
==
0
);
}
bool
Item_func_json_arrayagg
::
fix_fields
(
THD
*
thd
,
Item
**
ref
)
{
bool
res
=
Item_func_group_concat
::
fix_fields
(
thd
,
ref
);
m_tmp_json
.
set_charset
(
collation
.
collation
);
return
res
;
}
String
*
Item_func_json_arrayagg
::
get_str_from_item
(
Item
*
i
,
String
*
tmp
)
{
...
...
sql/item_jsonfunc.h
View file @
8bbf6697
...
...
@@ -570,6 +570,7 @@ class Item_func_json_arrayagg : public Item_func_group_concat
}
const
char
*
func_name
()
const
override
{
return
"json_arrayagg("
;
}
bool
fix_fields
(
THD
*
thd
,
Item
**
ref
)
override
;
enum
Sumfunctype
sum_func
()
const
override
{
return
JSON_ARRAYAGG_FUNC
;
}
String
*
val_str
(
String
*
str
)
override
;
...
...
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