diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-06-13 19:01:28 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-06-13 19:01:28 +0300 |
commit | 805340936aa47493886bafd119863d83c475f45c (patch) | |
tree | 46e5a4bd2e8311ef2880caa0526ce705a40c925e /strings | |
parent | f9e53a659c87f1147d4f6d004702077d4d0ce5d7 (diff) | |
parent | d83a4432503d199f6aed8e378563b08471d090dc (diff) | |
download | mariadb-git-805340936aa47493886bafd119863d83c475f45c.tar.gz |
Merge 10.3 into 10.4
Diffstat (limited to 'strings')
-rw-r--r-- | strings/ctype-utf8.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 01c549a7eaa..e579d7b2bc6 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -4968,8 +4968,8 @@ static size_t my_caseup_utf8(CHARSET_INFO *cs, const char *src, size_t srclen, } -static void my_hash_sort_utf8_nopad(CHARSET_INFO *cs, const uchar *s, size_t slen, - ulong *nr1, ulong *nr2) +static void my_hash_sort_utf8mb3_nopad(CHARSET_INFO *cs, const uchar *s, size_t slen, + ulong *nr1, ulong *nr2) { my_wc_t wc; int res; @@ -4988,17 +4988,15 @@ static void my_hash_sort_utf8_nopad(CHARSET_INFO *cs, const uchar *s, size_t sle } -static void my_hash_sort_utf8(CHARSET_INFO *cs, const uchar *s, size_t slen, - ulong *nr1, ulong *nr2) +static void my_hash_sort_utf8mb3(CHARSET_INFO *cs, const uchar *s, size_t slen, + ulong *nr1, ulong *nr2) { - const uchar *e= s+slen; /* Remove end space. We have to do this to be able to compare 'A ' and 'A' as identical */ - while (e > s && e[-1] == ' ') - e--; - my_hash_sort_utf8_nopad(cs, s, e - s, nr1, nr2); + const uchar *e= skip_trailing_space(s, slen); + my_hash_sort_utf8mb3_nopad(cs, s, e - s, nr1, nr2); } @@ -5365,7 +5363,7 @@ static MY_COLLATION_HANDLER my_collation_utf8_general_ci_handler = my_wildcmp_utf8, my_strcasecmp_utf8, my_instr_mb, - my_hash_sort_utf8, + my_hash_sort_utf8mb3, my_propagate_complex }; @@ -5381,7 +5379,7 @@ static MY_COLLATION_HANDLER my_collation_utf8_general_mysql500_ci_handler = my_wildcmp_utf8, my_strcasecmp_utf8, my_instr_mb, - my_hash_sort_utf8, + my_hash_sort_utf8mb3, my_propagate_complex }; @@ -5413,7 +5411,7 @@ static MY_COLLATION_HANDLER my_collation_utf8_general_nopad_ci_handler = my_wildcmp_utf8, my_strcasecmp_utf8, my_instr_mb, - my_hash_sort_utf8_nopad, + my_hash_sort_utf8mb3_nopad, my_propagate_complex }; @@ -7066,7 +7064,7 @@ static MY_COLLATION_HANDLER my_collation_filename_handler = my_wildcmp_utf8, my_strcasecmp_utf8, my_instr_mb, - my_hash_sort_utf8, + my_hash_sort_utf8mb3, my_propagate_complex }; @@ -7422,13 +7420,11 @@ static void my_hash_sort_utf8mb4(CHARSET_INFO *cs, const uchar *s, size_t slen, ulong *nr1, ulong *nr2) { - const uchar *e= s + slen; /* Remove end space. We do this to be able to compare 'A ' and 'A' as identical */ - while (e > s && e[-1] == ' ') - e--; + const uchar *e= skip_trailing_space(s, slen); my_hash_sort_utf8mb4_nopad(cs, s, e - s, nr1, nr2); } |