1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-26806 Server crash in Charset::charset / Item_func_natural_sort_key::val_str

The reason for crash is that natural_sort_key(release_lock('a')) would
evaluate release_lock() twice, once in Item::is_null() and another time
in Item::val_str(). Second time it returns NULL, since lock was already
released.

Fixed to prevent double evaluation.
This commit is contained in:
Vladislav Vaintroub
2021-10-12 10:17:52 +02:00
parent bc09362eb3
commit a6cf8b34a8
3 changed files with 13 additions and 2 deletions

View File

@ -206,3 +206,9 @@ 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
select get_lock('a', 0);
get_lock('a', 0)
1
select natural_sort_key(release_lock('a'));
natural_sort_key(release_lock('a'))
01