Commit afeb156b authored by marko's avatar marko

Revert r799, which was supposed to prevent similar cases as Bug #21638.

In reality, the patch breaks the handling of prefix indexes of
variable-length columns in ROW_FORMAT=COMPACT.  Reverting the patch
is only a partial fix of Bug #28138.
parent 608ee450
No related merge requests found
......@@ -1587,9 +1587,6 @@ dict_index_copy_types(
ifield = dict_index_get_nth_field(index, i);
dfield_type = dfield_get_type(dtuple_get_nth_field(tuple, i));
dict_col_copy_type(dict_field_get_col(ifield), dfield_type);
if (UNIV_UNLIKELY(ifield->prefix_len)) {
dfield_type->len = ifield->prefix_len;
}
}
}
......
......@@ -142,21 +142,16 @@ row_build_index_entry(
dfield_copy(dfield, dfield2);
/* If a column prefix index, take only the prefix */
if (ind_field->prefix_len) {
if (dfield_get_len(dfield2) != UNIV_SQL_NULL) {
if (ind_field->prefix_len > 0
&& dfield_get_len(dfield2) != UNIV_SQL_NULL) {
storage_len = dtype_get_at_most_n_mbchars(
col->prtype,
col->mbminlen, col->mbmaxlen,
col->prtype, col->mbminlen, col->mbmaxlen,
ind_field->prefix_len,
dfield_get_len(dfield2),
dfield2->data);
dfield_get_len(dfield2), dfield2->data);
dfield_set_len(dfield, storage_len);
}
dfield_get_type(dfield)->len = ind_field->prefix_len;
}
}
ut_ad(dtuple_check_typed(entry));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment