summaryrefslogtreecommitdiff
path: root/sql/item_jsonfunc.cc
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2019-03-12 01:09:55 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2019-03-12 01:09:55 +0400
commitacb4a872049e0ac23a1fdf7a1aaf12ed2bf858a2 (patch)
tree0cf4e5095972b076c71619bbdffd88a11502e635 /sql/item_jsonfunc.cc
parent28e713dc12881e7f50207d0c642523ca3e630114 (diff)
downloadmariadb-git-acb4a872049e0ac23a1fdf7a1aaf12ed2bf858a2.tar.gz
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.
Diffstat (limited to 'sql/item_jsonfunc.cc')
-rw-r--r--sql/item_jsonfunc.cc5
1 files changed, 3 insertions, 2 deletions
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;
}