summaryrefslogtreecommitdiff
path: root/storage/innobase/handler/ha_innodb.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/innobase/handler/ha_innodb.cc')
-rw-r--r--storage/innobase/handler/ha_innodb.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 0b75e3e336e..bd879c7c275 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -6320,7 +6320,8 @@ wsrep_innobase_mysql_sort(
// Note that strnxfrm may change length of string
tmp_length= charset->coll->strnxfrmlen(charset, str_length);
- tmp_length= ut_max(str_length, tmp_length) + 1;
+ tmp_length= tmp_length * charset->mbmaxlen;
+ tmp_length= ut_max(str_length, tmp_length) + charset->mbmaxlen;
tmp_str= static_cast<uchar *>(ut_malloc_nokey(tmp_length));
ut_ad(str_length <= tmp_length);
memcpy(tmp_str, str, str_length);
@@ -10960,6 +10961,8 @@ create_index(
prefix_len = 0;
}
+ ut_ad(prefix_len % field->charset()->mbmaxlen == 0);
+
field_lengths[i] = key_part->length;
if (!key_part->field->stored_in_db()) {