summaryrefslogtreecommitdiff
path: root/mysys/mf_iocache.c
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2016-06-15 13:53:19 +0200
committerSergei Golubchik <serg@mariadb.org>2016-06-15 13:53:19 +0200
commit1d21b22155242f604ab8e4a7b4ed92a422f61266 (patch)
tree8e4d87c0e86649386176f6a19155dcac0ebb17bc /mysys/mf_iocache.c
parentecdf46daedf156c2c8017166ce9373b1f0c7528c (diff)
downloadmariadb-git-1d21b22155242f604ab8e4a7b4ed92a422f61266.tar.gz
MDEV-10001 my_b_seek() may not work correctly after my_b_read() hits EOF
applied the patch from David Gow
Diffstat (limited to 'mysys/mf_iocache.c')
-rw-r--r--mysys/mf_iocache.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c
index a3cbaff68b0..06a76c68477 100644
--- a/mysys/mf_iocache.c
+++ b/mysys/mf_iocache.c
@@ -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);
}
/*
@@ -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;
@@ -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);
}
/*