From 410b6a9ebc1d6d4b0cae68da3ec7c5f5a6ec38f9 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 May 2005 07:18:41 -0700 Subject: Avoid doing a seek when first setting up the IO cache for a file, which allows a FIFO to be used for the non-binary logs. (Bug #8271) mysys/mf_iocache.c: Don't set seek_not_done if the position of the file is already where we expected it to be. --- mysys/mf_iocache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysys') diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index b86e9daf92d..32800c832b3 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -171,7 +171,7 @@ 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= test(file >= 0); + info->seek_not_done= test(file >= 0 && seek_offset != my_tell(file, MYF(0))); info->disk_writes= 0; #ifdef THREAD info->share=0; -- cgit v1.2.1 From fb00361bae9eb780a0724966121d93d0ed2f9ab9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 19 May 2005 14:43:10 -0700 Subject: Fix change to allow FIFO as log. (Bug #8271) mysys/mf_iocache.c: Reset seek_not_done after doing a seek. --- mysys/mf_iocache.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mysys') diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c index 32800c832b3..a55a2d81c2c 100644 --- a/mysys/mf_iocache.c +++ b/mysys/mf_iocache.c @@ -184,8 +184,10 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize, { /* Assume file isn't growing */ if (!(cache_myflags & MY_DONT_CHECK_FILESIZE)) { - /* Calculate end of file to not allocate to big buffers */ + /* Calculate end of file to avoid allocating oversized buffers */ end_of_file=my_seek(file,0L,MY_SEEK_END,MYF(0)); + /* Need to reset seek_not_done now that we just did a seek. */ + info->seek_not_done= end_of_file == seek_offset ? 0 : 1; if (end_of_file < seek_offset) end_of_file=seek_offset; /* Trim cache size if the file is very small */ -- cgit v1.2.1