mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 23:54:31 +02:00
bug in my_strnncoll_utf8 (and friends) fixed
cleanups better, charset-dependent, ft_max_len_for_sort value myisam/ftdefs.h: better ft_max_len_for_sort value myisam/mi_check.c: better, charset-dependent, ft_max_len_for_sort value myisam/myisamchk.c: unused value from enum removed myisam/sort.c: cleanup sql/mysql_priv.h: cleanup sql/mysqld.cc: cleanup sql/sql_acl.cc: cleanup sql/tztime.cc: cleanup strings/ctype-utf8.c: bug in my_strnncoll_utf8 (and friends) fixed
This commit is contained in:
parent
82257f94f4
commit
d8f416a26c
9 changed files with 252 additions and 235 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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,8 +3955,22 @@ static ha_checksum mi_byte_checksum(const byte *buf, uint length)
|
|||
return crc;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
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));
|
||||
}
|
||||
|
||||
/*
|
||||
Deactive all not unique index that can be recreated fast
|
||||
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.
|
||||
|
|
@ -3959,17 +3978,6 @@ static ha_checksum mi_byte_checksum(const byte *buf, uint length)
|
|||
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;
|
||||
return (key->flag & (HA_BINARY_PACK_KEY | HA_VAR_LENGTH_KEY | HA_FULLTEXT) &&
|
||||
((ulonglong) rows * key_maxlength >
|
||||
(ulonglong) myisam_max_temp_length));
|
||||
}
|
||||
|
||||
|
||||
void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows)
|
||||
{
|
||||
MYISAM_SHARE *share=info->s;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
@ -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…
Add table
Add a link
Reference in a new issue