diff --git a/storage/innobase/row/row0sel.cc b/storage/innobase/row/row0sel.cc index 66263ae7af5..599009ebcf3 100644 --- a/storage/innobase/row/row0sel.cc +++ b/storage/innobase/row/row0sel.cc @@ -329,6 +329,19 @@ static dberr_t row_sel_sec_rec_is_for_clust_rec( goto func_exit; } } else { + if (ifield->prefix_len == 0 && len != UNIV_SQL_NULL && + sec_len != UNIV_SQL_NULL && !col->is_virtual() && + rec_offs_nth_extern(clust_index, clust_offs, clust_pos)) { + clust_field = lob::btr_rec_copy_externally_stored_field( + trx, clust_index, clust_rec, clust_offs, dict_table_page_size(table), + clust_pos, &len, nullptr, dict_index_is_sdi(clust_index), heap); + + if (clust_field == nullptr) { + is_equal = false; + goto func_exit; + } + } + /* We are testing for equality; ASC/DESC does not matter */ if (0 != cmp_data_data(col->mtype, col->prtype, true, clust_field, len,