diff options
Diffstat (limited to 'myisam')
-rw-r--r-- | myisam/mi_check.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/myisam/mi_check.c b/myisam/mi_check.c index 60a2b664c70..246d2c58dde 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -1035,7 +1035,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend) { if ((((ulonglong) 1 << key) & info->s->state.key_map)) { - if(!(keyinfo->flag & HA_FULLTEXT)) + if(!(keyinfo->flag & HA_FULLTEXT)) { uint key_length=_mi_make_key(info,key,info->lastkey,record, start_recpos); @@ -1044,14 +1044,18 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend) /* We don't need to lock the key tree here as we don't allow concurrent threads when running myisamchk */ - if (_mi_search(info,keyinfo,info->lastkey,key_length, - SEARCH_SAME, info->s->state.key_root[key])) - { - mi_check_print_error(param,"Record at: %10s Can't find key for index: %2d", - llstr(start_recpos,llbuff),key+1); - if (error++ > MAXERR || !(param->testflag & T_VERBOSE)) - goto err2; - } + int search_result= (keyinfo->flag & HA_SPATIAL) ? + rtree_find_first(info, key, info->lastkey, key_length, + SEARCH_SAME) : + _mi_search(info,keyinfo,info->lastkey,key_length, + SEARCH_SAME, info->s->state.key_root[key]); + if (search_result) + { + mi_check_print_error(param,"Record at: %10s Can't find key for index: %2d", + llstr(start_recpos,llbuff),key+1); + if (error++ > MAXERR || !(param->testflag & T_VERBOSE)) + goto err2; + } } else key_checksum[key]+=mi_byte_checksum((byte*) info->lastkey, |