diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2015-06-09 16:08:09 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2015-06-09 23:24:03 +0400 |
commit | 80f6b2259330f2bc4de1692b671ab553dc5b4353 (patch) | |
tree | a4e66963a6a2e096b36f806662fcd55365f94c85 /storage/myisam | |
parent | 3a50a8c9bed9163beb3373cee8e2a51b3550b72e (diff) | |
download | mariadb-git-80f6b2259330f2bc4de1692b671ab553dc5b4353.tar.gz |
MDEV-3870 - Valgrind warnings on OPTIMIZE MyISAM or Aria TABLE with disabled
keys
Fixed that OPTIMIZE TABLE against MyISAM/Aria table may write uninitialized key
root position for disabled keys.
Diffstat (limited to 'storage/myisam')
-rw-r--r-- | storage/myisam/mi_check.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/storage/myisam/mi_check.c b/storage/myisam/mi_check.c index 73558ce77b3..ff9ea4b82cb 100644 --- a/storage/myisam/mi_check.c +++ b/storage/myisam/mi_check.c @@ -1944,10 +1944,8 @@ int mi_sort_index(HA_CHECK *param, register MI_INFO *info, char * name) for (key= 0,keyinfo= &share->keyinfo[0]; key < share->base.keys ; key++,keyinfo++) { - if (! mi_is_key_active(info->s->state.key_map, key)) - continue; - - if (share->state.key_root[key] != HA_OFFSET_ERROR) + if (mi_is_key_active(info->s->state.key_map, key) && + share->state.key_root[key] != HA_OFFSET_ERROR) { index_pos[key]=param->new_file_pos; /* Write first block here */ if (sort_one_index(param,info,keyinfo,share->state.key_root[key], |