Commit e4f227c1 authored by marko's avatar marko

branches/zip: row_build_index_entry(): Fix errors introduced in r870.

Do not augment clustered index records.  When computing the prefix,
use dfield (where the prefix was copied), not dfield2 (the record in
the clustered index).
parent 8325ef9b
......@@ -87,9 +87,16 @@ row_build_index_entry(
if (index->type & DICT_UNIVERSAL) {
dtuple_set_n_fields_cmp(entry, entry_len);
ut_a(!ext);
} else {
dtuple_set_n_fields_cmp(
entry, dict_index_get_n_unique_in_tree(index));
if (dict_index_is_clust(index)) {
/* Do not fetch externally stored columns to
the clustered index. Such columns are handled
at a higher level. */
ext = NULL;
}
}
for (i = 0; i < entry_len; i++) {
......@@ -119,14 +126,13 @@ row_build_index_entry(
/* If a column prefix index, take only the prefix */
if (ind_field->prefix_len) {
if (dfield_get_len(dfield2) != UNIV_SQL_NULL) {
if (dfield_get_len(dfield) != UNIV_SQL_NULL) {
storage_len = dtype_get_at_most_n_mbchars(
col->prtype,
col->mbminlen, col->mbmaxlen,
ind_field->prefix_len,
dfield_get_len(dfield2),
dfield2->data);
dfield->len, dfield->data);
dfield_set_len(dfield, storage_len);
}
......
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