MDEV-36011 Server crashes in Charset::mbminlen / Item_func_vec_fromtext::val_str upon mixing vector type with string

This commit is contained in:
Sergei Golubchik 2025-02-03 12:27:03 +01:00
parent 6fc75e0868
commit a2f0234c82
3 changed files with 8 additions and 0 deletions

Binary file not shown.

View file

@ -79,3 +79,10 @@ select vec_fromtext(0x00000000);
--echo # MDEV-35220 Assertion `!item->null_value' failed upon VEC_TOTEXT call
--echo #
select vec_totext(`null`) from (values (null),(0x00000000)) x;
--echo #
--echo # MDEV-36011 Server crashes in Charset::mbminlen / Item_func_vec_fromtext::val_str upon mixing vector type with string
--echo #
select 0x31313131 in ('1111', vec_fromtext('[1]'));
--echo # End of 11. tests

View file

@ -142,6 +142,7 @@ String *Item_func_vec_fromtext::val_str(String *buf)
return nullptr;
buf->length(0);
buf->set_charset(&my_charset_bin);
CHARSET_INFO *cs= value->charset();
const uchar *start= reinterpret_cast<const uchar *>(value->ptr());
const uchar *end= start + value->length();