|
|
|
@ -506,7 +506,7 @@ int thr_write_keys(MI_SORT_PARAM *sort_param) |
|
|
|
|
|
|
|
for (i= 0, sinfo= sort_param ; |
|
|
|
i < sort_info->total_keys ; |
|
|
|
i++, rec_per_key_part+=sinfo->keyinfo->keysegs, sinfo++) |
|
|
|
i++, sinfo++) |
|
|
|
{ |
|
|
|
if (!sinfo->sort_keys) |
|
|
|
{ |
|
|
|
@ -529,11 +529,6 @@ int thr_write_keys(MI_SORT_PARAM *sort_param) |
|
|
|
flush_ft_buf(sinfo) || flush_pending_blocks(sinfo)) |
|
|
|
got_error=1; |
|
|
|
} |
|
|
|
if (!got_error && param->testflag & T_STATISTICS) |
|
|
|
update_key_parts(sinfo->keyinfo, rec_per_key_part, sinfo->unique, |
|
|
|
param->stats_method == MI_STATS_METHOD_IGNORE_NULLS? |
|
|
|
sinfo->notnull: NULL, |
|
|
|
(ulonglong) info->state->records); |
|
|
|
} |
|
|
|
my_free((uchar*) sinfo->sort_keys,MYF(0)); |
|
|
|
my_free(mi_get_rec_buff_ptr(info, sinfo->rec_buff), |
|
|
|
@ -547,7 +542,7 @@ int thr_write_keys(MI_SORT_PARAM *sort_param) |
|
|
|
delete_dynamic(&sinfo->buffpek), |
|
|
|
close_cached_file(&sinfo->tempfile), |
|
|
|
close_cached_file(&sinfo->tempfile_for_exceptions), |
|
|
|
sinfo++) |
|
|
|
rec_per_key_part+= sinfo->keyinfo->keysegs, sinfo++) |
|
|
|
{ |
|
|
|
if (got_error) |
|
|
|
continue; |
|
|
|
@ -639,6 +634,11 @@ int thr_write_keys(MI_SORT_PARAM *sort_param) |
|
|
|
got_error=1; |
|
|
|
} |
|
|
|
} |
|
|
|
if (!got_error && param->testflag & T_STATISTICS) |
|
|
|
update_key_parts(sinfo->keyinfo, rec_per_key_part, sinfo->unique, |
|
|
|
param->stats_method == MI_STATS_METHOD_IGNORE_NULLS ? |
|
|
|
sinfo->notnull : NULL, |
|
|
|
(ulonglong) info->state->records); |
|
|
|
} |
|
|
|
my_free((uchar*) mergebuf,MYF(MY_ALLOW_ZERO_PTR)); |
|
|
|
DBUG_RETURN(got_error); |
|
|
|
|