diff options
author | Sergey Vojtovich <svoj@sun.com> | 2010-03-12 14:43:30 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@sun.com> | 2010-03-12 14:43:30 +0400 |
commit | e0aadfd491700fc072ffee1e1612f52fa5fc39b1 (patch) | |
tree | 08c99f355e15327ea040ee174b8368ac0c48a628 /storage/myisam | |
parent | b182c9bd2030c3b3c548157d1bc4c01c306b2c5c (diff) | |
download | mariadb-git-e0aadfd491700fc072ffee1e1612f52fa5fc39b1.tar.gz |
BUG#47444 - --myisam_repair_threads>1can result in all
index cardinalities=1
Parallel repair didn't poroperly update index cardinality
in certain cases.
When myisam_sort_buffer_size is not enough to store all
keys, index cardinality was updated before index was
actually written, when no index statistic is available.
mysql-test/r/myisam.result:
A test case for BUG#47444.
mysql-test/t/myisam.test:
A test case for BUG#47444.
storage/myisam/sort.c:
update_key_parts() must be called after all index
entries are written, when index statistic is available.
Diffstat (limited to 'storage/myisam')
-rw-r--r-- | storage/myisam/sort.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/storage/myisam/sort.c b/storage/myisam/sort.c index b450d27de66..e01dad68555 100644 --- a/storage/myisam/sort.c +++ b/storage/myisam/sort.c @@ -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); |