MDEV-26518 ; Galera incorrectly handles primary or unique keys with any multi-byte character set

We need to set temporary buffer large enough to fit also multi-byte
characters.
This commit is contained in:
Jan Lindström 2021-09-01 14:30:18 +03:00
commit f55477060c
5 changed files with 110 additions and 1 deletions

View file

@ -6750,7 +6750,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);