From acb4a872049e0ac23a1fdf7a1aaf12ed2bf858a2 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Tue, 12 Mar 2019 01:09:55 +0400 Subject: MDEV-18886 JSON_ARRAY() does not recognise JSON argument. JSON_ARRAY and JSON_OBJECT functions with no arguments now get the connection charset. Item_func_convert_charset returns the correct is_json() flag. --- sql/item_jsonfunc.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sql/item_jsonfunc.cc') diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index 27bc97f4c5e..78eb58506ff 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -1488,9 +1488,10 @@ bool Item_func_json_array::fix_length_and_dec() if (arg_count == 0) { - collation.set(&my_charset_utf8_general_ci, + THD* thd= current_thd; + collation.set(thd->variables.collation_connection, DERIVATION_COERCIBLE, MY_REPERTOIRE_ASCII); - tmp_val.set_charset(&my_charset_utf8_general_ci); + tmp_val.set_charset(thd->variables.collation_connection); max_length= 2; return FALSE; } -- cgit v1.2.1