summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authormsvensson@pilot.blaudden <>2007-02-20 12:06:04 +0100
committermsvensson@pilot.blaudden <>2007-02-20 12:06:04 +0100
commit0b5c41acc70395e03798dcf715967244d10407c3 (patch)
tree7108d4ce9f08c4a203314fcdeba165ee8d4c61b7 /mysys
parent269d9daf0d0ee5b13593dde68becd4f62ad8334d (diff)
downloadmariadb-git-0b5c41acc70395e03798dcf715967244d10407c3.tar.gz
Bug#25807 LOAD DATA INFILE does not work with Pipes
- Additional fix for io_cache_init being called on a closed file
Diffstat (limited to 'mysys')
-rw-r--r--mysys/mf_iocache.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c
index e40490776f8..d2ace12da4d 100644
--- a/mysys/mf_iocache.c
+++ b/mysys/mf_iocache.c
@@ -170,24 +170,28 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize,
info->arg = 0;
info->alloced_buffer = 0;
info->buffer=0;
+ info->seek_not_done= 0;
- pos= my_tell(file, MYF(0));
- if ((pos == (my_off_t) -1) && (my_errno == ESPIPE))
+ if (file >= 0)
{
- /*
- 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;
- /*
- Additionally, if we're supposed to start somewhere other than the
- the beginning of whatever this file is, then somebody made a bad
- assumption.
- */
- DBUG_ASSERT(seek_offset == 0);
+ pos= my_tell(file, MYF(0));
+ 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;
+ /*
+ Additionally, if we're supposed to start somewhere other than the
+ the beginning of whatever this file is, then somebody made a bad
+ assumption.
+ */
+ DBUG_ASSERT(seek_offset == 0);
+ }
+ else
+ info->seek_not_done= test(seek_offset != pos);
}
- else
- info->seek_not_done= test(file >= 0 && seek_offset != pos);
info->disk_writes= 0;
#ifdef THREAD