Bug#4053: too many of "error 1236: 'binlog truncated in the middle of \
event' from master" Since there is no repeatable test case, and this is obviously wrong, this is the most conservative change that might possibly work. The syscall read() wasn't checked for a negative return value for an interrupted read. The kernel sys_read() returns -EINTR, and the "library" layer maps that to return value of -1 and sets errno to EINTR. It's impossible (on Linux) for read() to set errno EINTR without the return value being -1 . So, if we're checking for EINTR behavior, we should not require that the return value be zero.
This commit is contained in:
parent
46ee3ac19d
commit
2c356ec7db
@ -51,8 +51,11 @@ uint my_read(File Filedes, byte *Buffer, uint Count, myf MyFlags)
|
||||
DBUG_PRINT("warning",("Read only %ld bytes off %ld from %d, errno: %d",
|
||||
readbytes, Count, Filedes, my_errno));
|
||||
#ifdef THREAD
|
||||
if (readbytes == 0 && errno == EINTR)
|
||||
if ((int) readbytes <= 0 && errno == EINTR)
|
||||
{
|
||||
DBUG_PRINT("debug", ("my_read() was interrupted and returned %d", (int) readbytes));
|
||||
continue; /* Interrupted */
|
||||
}
|
||||
#endif
|
||||
if (MyFlags & (MY_WME | MY_FAE | MY_FNABP))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user