Loading myisam/ftdefs.h +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ #define misc_word_char(X) ((X)=='\'') #define word_char(s,X) (true_word_char(s,X) || misc_word_char(X)) #define FT_MAX_WORD_LEN_FOR_SORT 20 #define FT_MAX_WORD_LEN_FOR_SORT 31 #define COMPILE_STOPWORDS_IN Loading myisam/mi_check.c +22 −14 Original line number Diff line number Diff line Loading @@ -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 { Loading Loading @@ -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; Loading Loading @@ -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; Loading Loading @@ -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) { Loading myisam/mi_search.c +2 −3 Original line number Diff line number Diff line Loading @@ -451,9 +451,8 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, /* We have to compare k and vseg as if they where space extended */ for (end=vseg + (len-cmplen) ; vseg < end && *vseg == (uchar) ' '; vseg++) ; if (vseg == end) goto cmp_rest; /* should never happen */ vseg++, matched++) ; DBUG_ASSERT(vseg < end); if (*vseg > (uchar) ' ') { Loading myisam/myisamchk.c +1 −1 Original line number Diff line number Diff line Loading @@ -154,7 +154,7 @@ enum options_mc { OPT_KEY_CACHE_BLOCK_SIZE, OPT_MYISAM_BLOCK_SIZE, OPT_READ_BUFFER_SIZE, OPT_WRITE_BUFFER_SIZE, OPT_SORT_BUFFER_SIZE, OPT_SORT_KEY_BLOCKS, OPT_DECODE_BITS, OPT_FT_MIN_WORD_LEN, OPT_FT_MAX_WORD_LEN, OPT_FT_MAX_WORD_LEN_FOR_SORT, OPT_FT_STOPWORD_FILE, OPT_FT_MAX_WORD_LEN, OPT_FT_STOPWORD_FILE, OPT_MAX_RECORD_LENGTH }; Loading myisam/sort.c +3 −1 Original line number Diff line number Diff line Loading @@ -204,7 +204,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, reinit_io_cache(&tempfile,READ_CACHE,0L,0,0)) goto err; /* purecov: inspected */ if (!no_messages) puts(" - Last merge and dumping keys\n"); /* purecov: tested */ printf(" - Last merge and dumping keys\n"); /* purecov: tested */ if (merge_index(info,keys,sort_keys,dynamic_element(&buffpek,0,BUFFPEK *), maxbuffer,&tempfile)) goto err; /* purecov: inspected */ Loading @@ -219,6 +219,8 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, uint keyno=info->key; uint key_length, ref_length=index->s->rec_reflength; if (!no_messages) printf(" - Adding exceptions\n"); /* purecov: tested */ if (flush_io_cache(&tempfile_for_exceptions) || reinit_io_cache(&tempfile_for_exceptions,READ_CACHE,0L,0,0)) goto err; Loading Loading
myisam/ftdefs.h +1 −1 Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ #define misc_word_char(X) ((X)=='\'') #define word_char(s,X) (true_word_char(s,X) || misc_word_char(X)) #define FT_MAX_WORD_LEN_FOR_SORT 20 #define FT_MAX_WORD_LEN_FOR_SORT 31 #define COMPILE_STOPWORDS_IN Loading
myisam/mi_check.c +22 −14 Original line number Diff line number Diff line Loading @@ -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 { Loading Loading @@ -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; Loading Loading @@ -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; Loading Loading @@ -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) { Loading
myisam/mi_search.c +2 −3 Original line number Diff line number Diff line Loading @@ -451,9 +451,8 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, /* We have to compare k and vseg as if they where space extended */ for (end=vseg + (len-cmplen) ; vseg < end && *vseg == (uchar) ' '; vseg++) ; if (vseg == end) goto cmp_rest; /* should never happen */ vseg++, matched++) ; DBUG_ASSERT(vseg < end); if (*vseg > (uchar) ' ') { Loading
myisam/myisamchk.c +1 −1 Original line number Diff line number Diff line Loading @@ -154,7 +154,7 @@ enum options_mc { OPT_KEY_CACHE_BLOCK_SIZE, OPT_MYISAM_BLOCK_SIZE, OPT_READ_BUFFER_SIZE, OPT_WRITE_BUFFER_SIZE, OPT_SORT_BUFFER_SIZE, OPT_SORT_KEY_BLOCKS, OPT_DECODE_BITS, OPT_FT_MIN_WORD_LEN, OPT_FT_MAX_WORD_LEN, OPT_FT_MAX_WORD_LEN_FOR_SORT, OPT_FT_STOPWORD_FILE, OPT_FT_MAX_WORD_LEN, OPT_FT_STOPWORD_FILE, OPT_MAX_RECORD_LENGTH }; Loading
myisam/sort.c +3 −1 Original line number Diff line number Diff line Loading @@ -204,7 +204,7 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, reinit_io_cache(&tempfile,READ_CACHE,0L,0,0)) goto err; /* purecov: inspected */ if (!no_messages) puts(" - Last merge and dumping keys\n"); /* purecov: tested */ printf(" - Last merge and dumping keys\n"); /* purecov: tested */ if (merge_index(info,keys,sort_keys,dynamic_element(&buffpek,0,BUFFPEK *), maxbuffer,&tempfile)) goto err; /* purecov: inspected */ Loading @@ -219,6 +219,8 @@ int _create_index_by_sort(MI_SORT_PARAM *info,my_bool no_messages, uint keyno=info->key; uint key_length, ref_length=index->s->rec_reflength; if (!no_messages) printf(" - Adding exceptions\n"); /* purecov: tested */ if (flush_io_cache(&tempfile_for_exceptions) || reinit_io_cache(&tempfile_for_exceptions,READ_CACHE,0L,0,0)) goto err; Loading