Commit c0621787 authored by cbell/Chuck@mysql_cab's avatar cbell/Chuck@mysql_cab

BUG#23735 Test rpl_row_mysqlbinlog fails on Windows. The errors report a file...

BUG#23735 Test rpl_row_mysqlbinlog fails on Windows. The errors report a file discrepency on reading a binlog from the command line.
parent d19c38db
......@@ -1360,6 +1360,24 @@ static int dump_local_log_entries(const char* logname)
}
else // reading from stdin;
{
/*
Bug fix: #23735
Author: Chuck Bell
Description:
Windows opens stdin in text mode by default. Certain characters
such as CTRL-Z are interpeted as events and the read() method
will stop. CTRL-Z is the EOF marker in Windows. to get past this
you have to open stdin in binary mode. Setmode() is used to set
stdin in binary mode. Errors on setting this mode result in
halting the function and printing an error message to stderr.
*/
#if defined (__WIN__) || (_WIN64)
if (_setmode(fileno(stdin), O_BINARY) == -1)
{
fprintf(stderr, "Could not set binary mode on stdin.\n");
return 1;
}
#endif
if (init_io_cache(file, fileno(stdin), 0, READ_CACHE, (my_off_t) 0,
0, MYF(MY_WME | MY_NABP | MY_DONT_CHECK_FILESIZE)))
return 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment