The crash is in test_if_skip_sort_order() in the line:
if (used_key_parts > used_index_parts) used_pk_parts= used_key_parts-used_index_parts; rec_per_key= keyinfo->rec_per_key[used_key_parts-1];
where used_key_parts == 0, which results in an access to keyinfo->rec_per_key[-1]
The crash is in test_if_ skip_sort_ order() in the line:
if (used_key_parts > used_index_parts)
used_pk_ parts= used_key_ parts-used_ index_parts;
rec_ per_key= keyinfo- >rec_per_ key[used_ key_parts- 1];
where used_key_parts == 0, which results in an access to >rec_per_ key[-1]
keyinfo-