diff options
Diffstat (limited to 'innobase/row/row0sel.c')
-rw-r--r-- | innobase/row/row0sel.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index 2c0092adc6e..d87cc857651 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -76,6 +76,7 @@ row_sel_sec_rec_is_for_clust_rec( ulint clust_len; ulint n; ulint i; + dtype_t* cur_type; UT_NOT_USED(clust_index); @@ -91,10 +92,18 @@ row_sel_sec_rec_is_for_clust_rec( sec_field = rec_get_nth_field(sec_rec, i, &sec_len); if (ifield->prefix_len > 0 - && clust_len != UNIV_SQL_NULL - && clust_len > ifield->prefix_len) { + && clust_len != UNIV_SQL_NULL) { - clust_len = ifield->prefix_len; + /* For prefix keys get the storage length + for the prefix_len characters. */ + + cur_type = dict_col_get_type( + dict_field_get_col(ifield)); + + clust_len = innobase_get_at_most_n_mbchars( + dtype_get_charset_coll(cur_type->prtype), + ifield->prefix_len, + clust_len,clust_field); } if (0 != cmp_data_data(dict_col_get_type(col), |