From 19a82a9f2a107af99d66c0f6d6cc489c108c88eb Mon Sep 17 00:00:00 2001 From: Oleksandr Byelkin Date: Thu, 24 Jan 2019 10:43:27 +0100 Subject: MDEV-17401: LOAD DATA from very big file into MyISAM table results in EOF error and corrupt index fix of incorrect 10.3 merge --- mysys/mf_iocache.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index 4f22921aeff..b09760cd98d 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -115,12 +115,15 @@ init_functions(IO_CACHE* info) DBUG_ASSERT(!(info->myflags & MY_ENCRYPT)); info->read_function = info->share ? _my_b_cache_read_r : _my_b_cache_read; info->write_function = info->share ? _my_b_cache_write_r : _my_b_cache_write; - info->myflags&= ~MY_FULL_IO; break; case TYPE_NOT_SET: DBUG_ASSERT(0); break; } + if (type == READ_CACHE || type == WRITE_CACHE || type == SEQ_READ_APPEND) + info->myflags|= MY_FULL_IO; + else + info->myflags&= ~MY_FULL_IO; } @@ -297,10 +300,6 @@ int init_io_cache(IO_CACHE *info, File file, size_t cachesize, } info->inited=info->aio_result.pending=0; #endif - if (type == READ_CACHE || type == WRITE_CACHE || type == SEQ_READ_APPEND) - info->myflags|= MY_FULL_IO; - else - info->myflags&= ~MY_FULL_IO; DBUG_RETURN(0); } /* init_io_cache */ @@ -469,8 +468,6 @@ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type, { info->read_end=info->write_pos; info->end_of_file=my_b_tell(info); - /* Ensure we will read all data */ - info->myflags|= MY_FULL_IO; /* Trigger a new seek only if we have a valid file handle. @@ -485,7 +482,6 @@ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type, info->seek_not_done=1; } info->end_of_file = ~(my_off_t) 0; - info->myflags&= ~MY_FULL_IO; } pos=info->request_pos+(seek_offset-info->pos_in_file); if (type == WRITE_CACHE) -- cgit v1.2.1