Commit bc09362e authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

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

Fixed typo, added test.
parent 5b5a67b2
......@@ -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
......@@ -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);
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment