1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-21062 Do not use popen() in text mode for mysql_upgrade.

This commit is contained in:
Vladislav Vaintroub
2019-11-21 01:51:34 +01:00
parent 9d4da68502
commit f60eeee952

View File

@@ -383,11 +383,20 @@ static int run_command(char* cmd,
if (opt_verbose >= 4)
puts(cmd);
if (!(res_file= my_popen(cmd, IF_WIN("rt","r"))))
if (!(res_file= my_popen(cmd, "r")))
die("popen(\"%s\", \"r\") failed", cmd);
while (fgets(buf, sizeof(buf), res_file))
{
#ifdef _WIN32
/* Strip '\r' off newlines. */
size_t len = strlen(buf);
if (len > 1 && buf[len - 2] == '\r' && buf[len - 1] == '\n')
{
buf[len - 2] = '\n';
buf[len - 1] = 0;
}
#endif
DBUG_PRINT("info", ("buf: %s", buf));
if(ds_res)
{