1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-26796 Natural sort does not work for utf32/utf16/ucs2

Fixed typo, added test.
This commit is contained in:
Vladislav Vaintroub
2021-10-11 09:27:38 +02:00
parent 5b5a67b2a9
commit bc09362eb3
3 changed files with 6 additions and 1 deletions

View File

@ -203,3 +203,6 @@ NULL NULL
a2 a02
a11 a111
drop table t;
select natural_sort_key(_utf16 0x0031),natural_sort_key(_ucs2 0x0031), natural_sort_key(_utf32 0x00000031);
natural_sort_key(_utf16 0x0031) natural_sort_key(_ucs2 0x0031) natural_sort_key(_utf32 0x00000031)
01 01 01

View File

@ -93,3 +93,5 @@ select * from t order by b;
select a, b from t order by b;
drop table t;
# MDEV-26796 Natural sort does not work for utf32/utf16/ucs2
select natural_sort_key(_utf16 0x0031),natural_sort_key(_ucs2 0x0031), natural_sort_key(_utf32 0x00000031);

View File

@ -5657,7 +5657,7 @@ String *Item_func_natural_sort_key::val_str(String *out)
*/
if (cs->mbminlen != 1)
{
if (!tmp.copy(in, &my_charset_utf8mb4_bin, &errs))
if (tmp.copy(in, &my_charset_utf8mb4_bin, &errs))
goto error_exit;
in= &tmp;
}