Fixed possible access to unintialized memory in filesort when using many buffers

include/my_sys.h:
  Added function to call if IO_CACHE is moved
mysys/mf_iocache.c:
  Added function to call if IO_CACHE is moved
sql/filesort.cc:
  Tell that io_cache is moved
This commit is contained in:
unknown 2005-01-15 03:47:06 +02:00
commit deac81af88
3 changed files with 38 additions and 14 deletions

View file

@ -680,6 +680,8 @@ int merge_many_buff(SORTPARAM *param, uchar *sort_buffer,
if (flush_io_cache(to_file))
break; /* purecov: inspected */
temp=from_file; from_file=to_file; to_file=temp;
setup_io_cache(from_file);
setup_io_cache(to_file);
*maxbuffer= (uint) (lastbuff-buffpek)-1;
}
close_cached_file(to_file); // This holds old result