Commit 1a54cf62 authored by Alexey Botchkov's avatar Alexey Botchkov

MDEV-24585 Assertion `je->s.cs == nice_js->charset()' failed in json_nice.

We should set the charset in
Item_func_json_format::fix_length_and_dec().
parent 53167031
......@@ -934,5 +934,11 @@ CAST(JSON_EXTRACT('{"x":false}', '$.x') AS DECIMAL) AS cd;
cf cd
0 0
#
# MDEV-24585 Assertion `je->s.cs == nice_js->charset()' failed in json_nice.
#
SELECT JSON_REPLACE( JSON_DETAILED('["x"]'), '$.a', 'xx' );
JSON_REPLACE( JSON_DETAILED('["x"]'), '$.a', 'xx' )
["x"]
#
# End of 10.2 tests
#
......@@ -554,6 +554,12 @@ SELECT
CAST(JSON_EXTRACT('{"x":false}', '$.x') AS DECIMAL) AS cd;
--echo #
--echo # MDEV-24585 Assertion `je->s.cs == nice_js->charset()' failed in json_nice.
--echo #
SELECT JSON_REPLACE( JSON_DETAILED('["x"]'), '$.a', 'xx' );
--echo #
--echo # End of 10.2 tests
--echo #
......@@ -3534,6 +3534,7 @@ const char *Item_func_json_format::func_name() const
bool Item_func_json_format::fix_length_and_dec()
{
decimals= 0;
collation.set(args[0]->collation);
max_length= args[0]->max_length;
maybe_null= 1;
return FALSE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment