diff --git a/strings/ctype.cc b/strings/ctype.cc index 6fd5fb427b6..9dd11c728d4 100644 --- a/strings/ctype.cc +++ b/strings/ctype.cc @@ -942,7 +942,14 @@ size_t my_convert(char *to, size_t to_length, const CHARSET_INFO *to_cs, length = length2 = MY_MIN(to_length, from_length); -#if defined(__i386__) || defined(_WIN32) || defined(__x86_64__) +#if defined(__x86_64__) || defined(__aarch64__) + for (; length >= 8; length -= 8, from += 8, to += 8) { + if (uint8korr(from) & 0x8080808080808080) break; + int8store(to, uint8korr(from)); + } +#endif /* defined(__x86_64__) || defined(__aarch64__) */ + +#if defined(__i386__) || defined(_WIN32) || defined(__x86_64__) || defined(__aarch64__) /* Special loop for i386, it allows to refer to a non-aligned memory block as UINT32, which makes