mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-24335 Unexpected question mark in the end of a TINYTEXT column
my_copy_fix_mb() passed MIN(src_length,dst_length) to my_append_fix_badly_formed_tail(). It could break a multi-byte character in the middle, which put the question mark to the destination. Fixing the code to pass the true src_length to my_append_fix_badly_formed_tail().
This commit is contained in:
@@ -401,10 +401,10 @@ my_copy_fix_mb(CHARSET_INFO *cs,
|
||||
size_t well_formed_nchars;
|
||||
size_t well_formed_length;
|
||||
size_t fixed_length;
|
||||
size_t min_length= MY_MIN(src_length, dst_length);
|
||||
|
||||
set_if_smaller(src_length, dst_length);
|
||||
well_formed_nchars= cs->cset->well_formed_char_length(cs,
|
||||
src, src + src_length,
|
||||
src, src + min_length,
|
||||
nchars, status);
|
||||
DBUG_ASSERT(well_formed_nchars <= nchars);
|
||||
well_formed_length= status->m_source_end_pos - src;
|
||||
|
Reference in New Issue
Block a user