384
if (flush_io_cache(&tempfile) || tempfile.reinit_io_cache(internal::READ_CACHE,0L,0,0))
384
if (tempfile.flush() || tempfile.reinit_io_cache(internal::READ_CACHE,0L,0,0))
1076
1076
if (*maxbuffer < MERGEBUFF2)
1078
if (flush_io_cache(t_file) ||
1078
if (t_file->flush() ||
1079
1079
t_file2.open_cached_file(drizzle_tmpdir.c_str(),TEMP_PREFIX,DISK_BUFFER_SIZE, MYF(MY_WME)))
1084
1084
from_file= t_file ; to_file= &t_file2;
1085
1085
while (*maxbuffer >= MERGEBUFF2)
1089
if (from_file->reinit_io_cache(internal::READ_CACHE,0L,0,0))
1094
if (to_file->reinit_io_cache(internal::WRITE_CACHE,0L,0,0))
1099
lastbuff=buffpek_inst;
1100
for (i=0 ; i <= *maxbuffer-MERGEBUFF*3/2 ; i+=MERGEBUFF)
1102
if (merge_buffers(param,from_file,to_file,sort_buffer,lastbuff++,
1103
buffpek_inst+i,buffpek_inst+i+MERGEBUFF-1,0))
1087
if (from_file->reinit_io_cache(internal::READ_CACHE, 0, 0, 0)
1088
|| to_file->reinit_io_cache(internal::WRITE_CACHE, 0, 0, 0))
1092
lastbuff= buffpek_inst;
1093
for (; i <= *maxbuffer - MERGEBUFF * 3 / 2; i += MERGEBUFF)
1095
if (merge_buffers(param, from_file, to_file, sort_buffer, lastbuff++, buffpek_inst + i, buffpek_inst + i + MERGEBUFF - 1, 0))
1109
if (merge_buffers(param,from_file,to_file,sort_buffer,lastbuff++,
1110
buffpek_inst+i,buffpek_inst+ *maxbuffer,0))
1115
if (flush_io_cache(to_file))
1101
if (merge_buffers(param, from_file, to_file, sort_buffer, lastbuff++, buffpek_inst + i, buffpek_inst + *maxbuffer, 0)
1102
|| to_file->flush())
1120
1105
temp=from_file; from_file=to_file; to_file=temp;
1121
1106
from_file->setup_io_cache();