1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-20466: SHOW PROCESSLIST truncates query text on \0 bytes

Data should be sent with length.
This commit is contained in:
Oleksandr Byelkin
2019-10-14 16:45:51 +02:00
parent ea61b79694
commit c2854c7863
5 changed files with 44 additions and 2 deletions

View File

@ -2278,8 +2278,12 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
else
protocol->store_null();
protocol->store(thd_info->state_info, system_charset_info);
protocol->store(thd_info->query_string.str(),
thd_info->query_string.charset());
if (thd_info->query_string.length())
protocol->store(thd_info->query_string.str(),
thd_info->query_string.length(),
thd_info->query_string.charset());
else
protocol->store_null();
if (!thd->variables.old_mode &&
!(thd->variables.old_behavior & OLD_MODE_NO_PROGRESS_INFO))
protocol->store(thd_info->progress, 3, &store_buffer);