diff options
author | serg@serg.mylan <> | 2004-08-30 08:37:36 +0200 |
---|---|---|
committer | serg@serg.mylan <> | 2004-08-30 08:37:36 +0200 |
commit | b60713c0339c951aed48343c88d996921d2928f4 (patch) | |
tree | db8d212cff4061f9779c0ff43088eb2ebf01affa /myisam/mi_check.c | |
parent | 08f3ba0e29aefb9aae54534fcd9f799eccf8ffc6 (diff) | |
download | mariadb-git-b60713c0339c951aed48343c88d996921d2928f4.tar.gz |
bug in my_strnncoll_utf8 (and friends) fixed
cleanups
better, charset-dependent, ft_max_len_for_sort value
Diffstat (limited to 'myisam/mi_check.c')
-rw-r--r-- | myisam/mi_check.c | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/myisam/mi_check.c b/myisam/mi_check.c index 052fa55a559..a1c3698b3e9 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -2020,12 +2020,14 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info, if (sort_param.keyinfo->flag & HA_FULLTEXT) { + uint ft_max_word_len_for_sort=FT_MAX_WORD_LEN_FOR_SORT* + sort_param.keyinfo->seg->charset->mbmaxlen; sort_info.max_records= - (ha_rows) (sort_info.filelength/FT_MAX_WORD_LEN_FOR_SORT+1); + (ha_rows) (sort_info.filelength/ft_max_word_len_for_sort+1); sort_param.key_read=sort_ft_key_read; sort_param.key_write=sort_ft_key_write; - sort_param.key_length+=FT_MAX_WORD_LEN_FOR_SORT-HA_FT_MAXBYTELEN; + sort_param.key_length+=ft_max_word_len_for_sort-HA_FT_MAXBYTELEN; } else { @@ -2425,7 +2427,11 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info, total_key_length+=sort_param[i].key_length; if (sort_param[i].keyinfo->flag & HA_FULLTEXT) - sort_param[i].key_length+=FT_MAX_WORD_LEN_FOR_SORT-HA_FT_MAXBYTELEN; + { + uint ft_max_word_len_for_sort=FT_MAX_WORD_LEN_FOR_SORT* + sort_param[i].keyinfo->seg->charset->mbmaxlen; + sort_param[i].key_length+=ft_max_word_len_for_sort-HA_FT_MAXBYTELEN; + } } sort_info.total_keys=i; sort_param[0].master= 1; @@ -2634,7 +2640,6 @@ static int sort_key_read(MI_SORT_PARAM *sort_param, void *key) DBUG_RETURN(sort_write_record(sort_param)); } /* sort_key_read */ - static int sort_ft_key_read(MI_SORT_PARAM *sort_param, void *key) { int error; @@ -3950,25 +3955,28 @@ static ha_checksum mi_byte_checksum(const byte *buf, uint length) return crc; } -/* - Deactive all not unique index that can be recreated fast - These include packed keys on which sorting will use more temporary - space than the max allowed file length or for which the unpacked keys - will take much more space than packed keys. - Note that 'rows' may be zero for the case when we don't know how many - rows we will put into the file. - */ - static my_bool mi_too_big_key_for_sort(MI_KEYDEF *key, ha_rows rows) { uint key_maxlength=key->maxlength; if (key->flag & HA_FULLTEXT) - key_maxlength+=FT_MAX_WORD_LEN_FOR_SORT-HA_FT_MAXBYTELEN; + { + uint ft_max_word_len_for_sort=FT_MAX_WORD_LEN_FOR_SORT* + key->seg->charset->mbmaxlen; + key_maxlength+=ft_max_word_len_for_sort-HA_FT_MAXBYTELEN; + } return (key->flag & (HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY | HA_FULLTEXT) && ((ulonglong) rows * key_maxlength > (ulonglong) myisam_max_temp_length)); } +/* + Deactivate all not unique index that can be recreated fast + These include packed keys on which sorting will use more temporary + space than the max allowed file length or for which the unpacked keys + will take much more space than packed keys. + Note that 'rows' may be zero for the case when we don't know how many + rows we will put into the file. + */ void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows) { |