Skip to content

Commit 1d21b22

Browse files
committed
MDEV-10001 my_b_seek() may not work correctly after my_b_read() hits EOF
applied the patch from David Gow
1 parent ecdf46d commit 1d21b22

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

mysys/mf_iocache.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
507507
{
508508
/* End of file. Return, what we did copy from the buffer. */
509509
info->error= (int) left_length;
510+
info->seek_not_done=1;
510511
DBUG_RETURN(1);
511512
}
512513
/*
@@ -524,6 +525,7 @@ int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
524525
*/
525526
info->error= (read_length == (size_t) -1 ? -1 :
526527
(int) (read_length+left_length));
528+
info->seek_not_done=1;
527529
DBUG_RETURN(1);
528530
}
529531
Count-=length;
@@ -572,6 +574,7 @@ int _my_b_read(register IO_CACHE *info, uchar *Buffer, size_t Count)
572574
/* For a read error, return -1, otherwise, what we got in total. */
573575
info->error= length == (size_t) -1 ? -1 : (int) (length+left_length);
574576
info->read_pos=info->read_end=info->buffer;
577+
info->seek_not_done=1;
575578
DBUG_RETURN(1);
576579
}
577580
/*

0 commit comments

Comments
 (0)