Commit 5cfb043d authored by Alexey Botchkov's avatar Alexey Botchkov

MDEV-16174 Assertion `0' failed in...

MDEV-16174 Assertion `0' failed in Type_handler_string_result::make_sort_key(uchar*, Item*, const SORT_FIELD_ATTR*, Sort_param*)

maybe_null should be always set to TRUE in
Item_func_json_array_append::fix_length_and_dec()
parent f5bcf788
......@@ -810,3 +810,17 @@ SET @`json` := NULL, @`value` := NULL;
SELECT JSON_MERGE('[1]', '[]');
JSON_MERGE('[1]', '[]')
[1]
#
# MDEV-16174 Assertion `0' failed in Type_handler_string_result::
# make_sort_key(uchar*, Item*, const SORT_FIELD_ATTR*, Sort_param*)
#
SET sql_mode='';
CREATE TABLE t1 (fld varchar(16) NOT NULL);
CREATE TABLE t2 SELECT JSON_ARRAY_INSERT(fld, '$.[0]', '0') FROM t1;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`JSON_ARRAY_INSERT(fld, '$.[0]', '0')` varchar(25) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1, t2;
SET sql_mode=default;
......@@ -468,3 +468,16 @@ SET @`json` := NULL, @`value` := NULL;
--echo #
SELECT JSON_MERGE('[1]', '[]');
--echo #
--echo # MDEV-16174 Assertion `0' failed in Type_handler_string_result::
--echo # make_sort_key(uchar*, Item*, const SORT_FIELD_ATTR*, Sort_param*)
--echo #
SET sql_mode='';
CREATE TABLE t1 (fld varchar(16) NOT NULL);
CREATE TABLE t2 SELECT JSON_ARRAY_INSERT(fld, '$.[0]', '0') FROM t1;
SHOW CREATE TABLE t2;
DROP TABLE t1, t2;
SET sql_mode=default;
......@@ -1562,6 +1562,7 @@ bool Item_func_json_array_append::fix_length_and_dec()
}
fix_char_length_ulonglong(char_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