Commit 71eea0c3 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Fix debug assert to match its intention.

Do not check my_errno before it is set, check errno instead.
Also, do not check errno, if prior pread() did not fail.
parent 5804bb4e
......@@ -69,7 +69,7 @@ size_t my_pread(File Filedes, uchar *Buffer, size_t Count, my_off_t offset,
if (readbytes != Count)
{
/* We should never read with wrong file descriptor! */
DBUG_ASSERT(my_errno != EBADF);
DBUG_ASSERT(readbytes != (size_t)-1 || errno != EBADF);
my_errno= errno;
if (errno == 0 || (readbytes != (size_t) -1 &&
(MyFlags & (MY_NABP | MY_FNABP))))
......
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