summaryrefslogtreecommitdiff
path: root/mysys/mf_iocache.c
diff options
context:
space:
mode:
Diffstat (limited to 'mysys/mf_iocache.c')
-rw-r--r--mysys/mf_iocache.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c
index 908f5c65cf7..c84a41bbec9 100644
--- a/mysys/mf_iocache.c
+++ b/mysys/mf_iocache.c
@@ -168,11 +168,9 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize,
if ((pos == (my_off_t) -1) && (my_errno == ESPIPE))
{
/*
- This kind of object doesn't support seek() or tell(). Don't set a
- flag that will make us again try to seek() later and fail.
- */
- info->seek_not_done= 0;
- /*
+ This kind of object doesn't support seek() or tell(). Don't set a
+ seek_not_done that will make us again try to seek() later and fail.
+
Additionally, if we're supposed to start somewhere other than the
the beginning of whatever this file is, then somebody made a bad
assumption.
@@ -1755,7 +1753,7 @@ int my_b_flush_io_cache(IO_CACHE *info,
*/
if (!append_cache && info->seek_not_done)
{ /* File touched, do seek */
- if (mysql_file_seek(info->file, pos_in_file, MY_SEEK_SET, MYF(0)) ==
+ if (mysql_file_seek(info->file, pos_in_file, MY_SEEK_SET, MYF(info->myflags & MY_WME)) ==
MY_FILEPOS_ERROR)
{
UNLOCK_APPEND_BUFFER;