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:
@@ -383,11 +383,20 @@ static int run_command(char* cmd,
|
|||||||
if (opt_verbose >= 4)
|
if (opt_verbose >= 4)
|
||||||
puts(cmd);
|
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);
|
die("popen(\"%s\", \"r\") failed", cmd);
|
||||||
|
|
||||||
while (fgets(buf, sizeof(buf), res_file))
|
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));
|
DBUG_PRINT("info", ("buf: %s", buf));
|
||||||
if(ds_res)
|
if(ds_res)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user