diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c index e4c7e37307b..518eba975ab 100644 --- a/storage/innobase/row/row0sel.c +++ b/storage/innobase/row/row0sel.c @@ -217,7 +217,8 @@ row_sel_sec_rec_is_for_clust_rec( len = clust_len; - if (ifield->prefix_len > 0 && len != UNIV_SQL_NULL) { + if (ifield->prefix_len > 0 && len != UNIV_SQL_NULL + && sec_len != UNIV_SQL_NULL) { if (rec_offs_nth_extern(clust_offs, clust_pos)) { len -= BTR_EXTERN_FIELD_REF_SIZE;