mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
MDEV-24784 JSON_ARRAYAGG charset issue
set the proper charset for a temporary result
This commit is contained in:
@ -1646,5 +1646,16 @@ SELECT JSON_OBJECTAGG('\\', 1);
|
|||||||
JSON_OBJECTAGG('\\', 1)
|
JSON_OBJECTAGG('\\', 1)
|
||||||
{"\\":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
|
# End of 10.5 tests
|
||||||
#
|
#
|
||||||
|
@ -1108,7 +1108,16 @@ SELECT JSON_OBJECTAGG('"', 1);
|
|||||||
SELECT JSON_OBJECTAGG('\"', 1);
|
SELECT JSON_OBJECTAGG('\"', 1);
|
||||||
SELECT JSON_OBJECTAGG('\\', 1);
|
SELECT JSON_OBJECTAGG('\\', 1);
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--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 #
|
||||||
--echo # End of 10.5 tests
|
--echo # End of 10.5 tests
|
||||||
--echo #
|
--echo #
|
||||||
|
|
||||||
|
@ -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);
|
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)
|
String *Item_func_json_arrayagg::get_str_from_item(Item *i, String *tmp)
|
||||||
{
|
{
|
||||||
|
@ -570,6 +570,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
const char *func_name() const override { return "json_arrayagg("; }
|
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; }
|
enum Sumfunctype sum_func() const override { return JSON_ARRAYAGG_FUNC; }
|
||||||
|
|
||||||
String* val_str(String *str) override;
|
String* val_str(String *str) override;
|
||||||
|
Reference in New Issue
Block a user