@ -260,4 +260,9 @@ x
2222
drop view v;
drop table t;
#
# MDEV-35919 Server crashes in Item_func_vec_distance::fix_length_and_dec upon reading from I_S table
select vec_distance(value(key_cache_name), 0x30303030) from information_schema.key_caches;
ERROR HY000: Cannot determine distance type for VEC_DISTANCE, index is not found
# End of 11.8 tests
@ -147,4 +147,10 @@ select * from v order by vec_distance(0x30303030, x);
--echo #
--echo # MDEV-35919 Server crashes in Item_func_vec_distance::fix_length_and_dec upon reading from I_S table
--error ER_VEC_DISTANCE_TYPE
--echo # End of 11.8 tests
@ -64,6 +64,8 @@ bool Item_func_vec_distance::fix_length_and_dec(THD *thd)
if (auto *item= dynamic_cast<Item_field*>(args[i]->real_item()))
{
TABLE_SHARE *share= item->field->orig_table->s;
if (share->tmp_table)
break;
Field *f= share->field[item->field->field_index];
KEY *kinfo= share->key_info;
for (uint j= share->keys; j < share->total_keys; j++)