diff options
Diffstat (limited to 'myisam/mi_check.c')
-rw-r--r-- | myisam/mi_check.c | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/myisam/mi_check.c b/myisam/mi_check.c index 540f3c92ad3..1ca342f3998 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -583,8 +583,8 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, goto err; } if ((*keys)++ && - (flag=_mi_key_cmp(keyinfo->seg,info->lastkey,key,key_length, - comp_flag, ¬_used)) >=0) + (flag=ha_key_cmp(keyinfo->seg,info->lastkey,key,key_length, + comp_flag, ¬_used)) >=0) { DBUG_DUMP("old",(byte*) info->lastkey, info->lastkey_length); DBUG_DUMP("new",(byte*) key, key_length); @@ -601,8 +601,8 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, if (*keys != 1L) /* not first_key */ { uint diff; - _mi_key_cmp(keyinfo->seg,info->lastkey,key,USE_WHOLE_KEY,SEARCH_FIND, - &diff); + ha_key_cmp(keyinfo->seg,info->lastkey,key,USE_WHOLE_KEY,SEARCH_FIND, + &diff); param->unique_count[diff-1]++; } } @@ -669,7 +669,7 @@ static ha_checksum calc_checksum(ha_rows count) static uint isam_key_length(MI_INFO *info, register MI_KEYDEF *keyinfo) { uint length; - MI_KEYSEG *keyseg; + HA_KEYSEG *keyseg; DBUG_ENTER("isam_key_length"); length= info->s->rec_reflength; @@ -1771,7 +1771,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info, File new_file; MI_SORT_PARAM sort_param; MYISAM_SHARE *share=info->s; - MI_KEYSEG *keyseg; + HA_KEYSEG *keyseg; ulong *rec_per_key_part; char llbuff[22]; SORT_INFO sort_info; @@ -2136,7 +2136,7 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info, MI_SORT_PARAM *sort_param=0; MYISAM_SHARE *share=info->s; ulong *rec_per_key_part; - MI_KEYSEG *keyseg; + HA_KEYSEG *keyseg; char llbuff[22]; IO_CACHE_SHARE io_share; SORT_INFO sort_info; @@ -2508,7 +2508,7 @@ static int sort_key_read(MI_SORT_PARAM *sort_param, void *key) DBUG_RETURN(1); } sort_param->real_key_length= - (info->s->rec_reflength+ + (info->s->rec_reflength+ _mi_make_key(info, sort_param->key, (uchar*) key, sort_param->record, sort_param->filepos)); #ifdef HAVE_purify @@ -2587,6 +2587,9 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param) char llbuff[22],llbuff2[22]; DBUG_ENTER("sort_get_next_record"); + if (*killed_ptr(param)) + DBUG_RETURN(1); + switch (share->data_file_type) { case STATIC_RECORD: for (;;) @@ -3052,8 +3055,8 @@ static int sort_key_cmp(MI_SORT_PARAM *sort_param, const void *a, const void *b) { uint not_used; - return (_mi_key_cmp(sort_param->keyinfo->seg,*((uchar**) a),*((uchar**) b), - USE_WHOLE_KEY, SEARCH_SAME,¬_used)); + return (ha_key_cmp(sort_param->keyinfo->seg, *((uchar**) a), *((uchar**) b), + USE_WHOLE_KEY, SEARCH_SAME,¬_used)); } /* sort_key_cmp */ @@ -3067,9 +3070,9 @@ static int sort_key_write(MI_SORT_PARAM *sort_param, const void *a) if (sort_info->key_block->inited) { - cmp=_mi_key_cmp(sort_param->keyinfo->seg, sort_info->key_block->lastkey, - (uchar*) a, USE_WHOLE_KEY, SEARCH_FIND | SEARCH_UPDATE, - &diff_pos); + cmp=ha_key_cmp(sort_param->keyinfo->seg,sort_info->key_block->lastkey, + (uchar*) a, USE_WHOLE_KEY,SEARCH_FIND | SEARCH_UPDATE, + &diff_pos); sort_param->unique[diff_pos-1]++; } else @@ -3080,13 +3083,16 @@ static int sort_key_write(MI_SORT_PARAM *sort_param, const void *a) { sort_info->dupp++; sort_info->info->lastpos=get_record_for_key(sort_info->info, - sort_param->keyinfo, - (uchar*) a); + sort_param->keyinfo, + (uchar*) a); mi_check_print_warning(param, - "Duplicate key for record at %10s against record at %10s", - llstr(sort_info->info->lastpos,llbuff), - llstr(get_record_for_key(sort_info->info, sort_param->keyinfo, - sort_info->key_block->lastkey), llbuff2)); + "Duplicate key for record at %10s against record at %10s", + llstr(sort_info->info->lastpos,llbuff), + llstr(get_record_for_key(sort_info->info, + sort_param->keyinfo, + sort_info->key_block-> + lastkey), + llbuff2)); param->testflag|=T_RETRY_WITHOUT_QUICK; if (sort_info->param->testflag & T_VERBOSE) _mi_print_key(stdout,sort_param->keyinfo->seg,(uchar*) a, USE_WHOLE_KEY); @@ -3342,7 +3348,7 @@ int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename) MI_INFO info; MYISAM_SHARE share; MI_KEYDEF *keyinfo,*key,*key_end; - MI_KEYSEG *keysegs,*keyseg; + HA_KEYSEG *keysegs,*keyseg; MI_COLUMNDEF *recdef,*rec,*end; MI_UNIQUEDEF *uniquedef,*u_ptr,*u_end; MI_STATUS_INFO status_info; @@ -3364,7 +3370,7 @@ int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename) (size_t) (sizeof(MI_KEYDEF)*share.base.keys)); key_parts= share.base.all_key_parts; - if (!(keysegs=(MI_KEYSEG*) my_alloca(sizeof(MI_KEYSEG)* + if (!(keysegs=(HA_KEYSEG*) my_alloca(sizeof(HA_KEYSEG)* (key_parts+share.base.keys)))) { my_afree((gptr) keyinfo); @@ -3400,7 +3406,7 @@ int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename) /* Change the new key to point at the saved key segments */ memcpy((byte*) keysegs,(byte*) share.keyparts, - (size_t) (sizeof(MI_KEYSEG)*(key_parts+share.base.keys+ + (size_t) (sizeof(HA_KEYSEG)*(key_parts+share.base.keys+ share.state.header.uniques))); keyseg=keysegs; for (key=keyinfo,key_end=keyinfo+share.base.keys; key != key_end ; key++) @@ -3676,10 +3682,7 @@ static my_bool mi_too_big_key_for_sort(MI_KEYDEF *key, ha_rows rows) key_maxlength+=ft_max_word_len_for_sort-HA_FT_MAXLEN; return (key->flag & (HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY | HA_FULLTEXT) && ((ulonglong) rows * key_maxlength > - (ulonglong) myisam_max_temp_length || - (ulonglong) rows * (key_maxlength - key->minlength) / 2 > - myisam_max_extra_temp_length || - (rows == 0 && (key_maxlength / key->minlength) > 2))); + (ulonglong) myisam_max_temp_length)); } |