Skip to content

Commit

Permalink
MDEV-10001 my_b_seek() may not work correctly after my_b_read() hits EOF
Browse files Browse the repository at this point in the history
applied the patch from  David Gow
  • Loading branch information
vuvova committed Jun 15, 2016
1 parent ecdf46d commit 1d21b22
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mysys/mf_iocache.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
{
/* End of file. Return, what we did copy from the buffer. */
info->error= (int) left_length;
info->seek_not_done=1;
DBUG_RETURN(1);
}
/*
Expand All @@ -524,6 +525,7 @@ int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
*/
info->error= (read_length == (size_t) -1 ? -1 :
(int) (read_length+left_length));
info->seek_not_done=1;
DBUG_RETURN(1);
}
Count-=length;
Expand Down Expand Up @@ -572,6 +574,7 @@ int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
/* For a read error, return -1, otherwise, what we got in total. */
info->error= length == (size_t) -1 ? -1 : (int) (length+left_length);
info->read_pos=info->read_end=info->buffer;
info->seek_not_done=1;
DBUG_RETURN(1);
}
/*
Expand Down

0 comments on commit 1d21b22

Please sign in to comment.