1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-22043 Special character leads to assertion in my_wc_to_printable_generic on 10.5.2 (debug)

The code did not take into account that:
- U+005C (backslash) can occupy more than mbminlen characters (e.g. in sjis)
- Some character sets do not have a code for U+005C (e.g. swe7)

Adding a new function my_wc_to_printable into MY_CHARSET_HANDLER to
cover all special cases easier.
This commit is contained in:
Alexander Barkov
2020-05-07 19:20:17 +04:00
parent c675886dcd
commit cfe5ee90c8
25 changed files with 242 additions and 18 deletions

View File

@ -850,7 +850,7 @@ extern "C" int my_wc_mb_utf8_null_terminated(CHARSET_INFO *cs,
my_wc_t wc, uchar *r, uchar *e)
{
return wc == '\0' ?
my_wc_to_printable_generic(cs, wc, r, e) :
cs->wc_to_printable(wc, r, e) :
my_charset_utf8mb3_handler.wc_mb(cs, wc, r, e);
}
@ -951,7 +951,7 @@ size_t convert_error_message(char *to, size_t to_length, CHARSET_INFO *to_cs,
to_cs= system_charset_info;
uint32 cnv_length= my_convert_using_func(to, to_length,
to_cs,
my_wc_to_printable_generic,
to_cs->cset->wc_to_printable,
from, from_length,
from_cs, from_cs->cset->mb_wc,
errors);