mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
MDEV-18880: Optimizer trace prints date in hexadecimal
Introduced a print_key_value function to makes sure that the trace prints data in readable format for readable characters and the rest of the characters are printed as hexadecimal.
This commit is contained in:
@ -1196,3 +1196,15 @@ uint convert_to_printable(char *to, size_t to_len,
|
||||
*t= '\0';
|
||||
return (uint) (t - to);
|
||||
}
|
||||
|
||||
|
||||
bool String::append_semi_hex(const char *s, uint len, CHARSET_INFO *cs)
|
||||
{
|
||||
size_t dst_len= len * 4 + 1; //extra length for the '\0' character
|
||||
if (reserve(dst_len))
|
||||
return true;
|
||||
uint nbytes= convert_to_printable(Ptr + str_length, dst_len, s, len, cs);
|
||||
DBUG_ASSERT((ulonglong) str_length + nbytes < UINT_MAX32);
|
||||
str_length+= nbytes;
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user