Bug#25807 LOAD DATA INFILE does not work with Pipes

 - Additional fix for io_cache_init being called on a closed file
parent 269d9daf
...@@ -170,13 +170,16 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize, ...@@ -170,13 +170,16 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize,
info->arg = 0; info->arg = 0;
info->alloced_buffer = 0; info->alloced_buffer = 0;
info->buffer=0; info->buffer=0;
info->seek_not_done= 0;
if (file >= 0)
{
pos= my_tell(file, MYF(0)); pos= my_tell(file, MYF(0));
if ((pos == (my_off_t) -1) && (my_errno == ESPIPE)) if ((pos == (my_off_t) -1) && (my_errno == ESPIPE))
{ {
/* /*
This kind of object doesn't support seek() or tell(). Don't set a flag This kind of object doesn't support seek() or tell(). Don't set a
that will make us again try to seek() later and fail. flag that will make us again try to seek() later and fail.
*/ */
info->seek_not_done= 0; info->seek_not_done= 0;
/* /*
...@@ -187,7 +190,8 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize, ...@@ -187,7 +190,8 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize,
DBUG_ASSERT(seek_offset == 0); DBUG_ASSERT(seek_offset == 0);
} }
else else
info->seek_not_done= test(file >= 0 && seek_offset != pos); info->seek_not_done= test(seek_offset != pos);
}
info->disk_writes= 0; info->disk_writes= 0;
#ifdef THREAD #ifdef THREAD
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment