| 810 | |
| 811 | |
| 812 | bool Binary_string::copy_printable_hhhh(CHARSET_INFO *to_cs, |
| 813 | CHARSET_INFO *from_cs, |
| 814 | const char *from, |
| 815 | size_t from_length) |
| 816 | { |
| 817 | DBUG_ASSERT(from_length < UINT_MAX32); |
| 818 | uint errors; |
| 819 | uint one_escaped_char_length= MY_CS_PRINTABLE_CHAR_LENGTH * to_cs->mbminlen; |
| 820 | uint one_char_length= MY_MAX(one_escaped_char_length, to_cs->mbmaxlen); |
| 821 | ulonglong bytes_needed= from_length * one_char_length; |
| 822 | if (bytes_needed >= UINT_MAX32 || alloc((size_t) bytes_needed)) |
| 823 | return true; |
| 824 | str_length= my_convert_using_func(Ptr, Alloced_length, to_cs, |
| 825 | to_cs->cset->wc_to_printable, |
| 826 | from, from_length, |
| 827 | from_cs, |
| 828 | from_cs->cset->mb_wc, |
| 829 | &errors); |
| 830 | return false; |
| 831 | } |
| 832 | |
| 833 | |
| 834 | /* |
no test coverage detected