mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 15:45:33 +02:00
BUG#51866 - crash with repair by sort and fulltext keys
Repairing MyISAM table with fulltext indexes and low myisam_sort_buffer_size may crash the server. Estimation of number of index entries was done incorrectly, causing further assertion failure or server crash. Docs note: min value for myisam_sort_buffer_size has been changed from 4 to 4096. mysql-test/r/fulltext.result: A test case for BUG#51866. mysql-test/r/myisam.result: Min value for myisam_sort_buffer_size is 4096. mysql-test/r/variables.result: Min value for myisam_sort_buffer_size is 4096. mysql-test/suite/sys_vars/r/myisam_sort_buffer_size_basic_32.result: Min value for myisam_sort_buffer_size is 4096. mysql-test/t/fulltext.test: A test case for BUG#51866. sql/mysqld.cc: Min value for myisam_sort_buffer_size is 4096. storage/myisam/mi_check.c: When estimating number of index entries for external fulltext parser, take into account that key_length may be bigger than myisam_sort_buffer_size. Reuse logic from _create_index_by_sort(): force MIN_SORT_BUFFER to be min value for myisam_sort_buffer_size. Another problem is that ftkey_nr has no other meaning than serial number of fulltext index starting with 1. We can't say if this key using built-in or external parser basing on it's value. In other words we always entered if-branch for external parser. At this point, the only way to check if we use default parser is to compare keyinfo::parser with &ft_default_parser. storage/myisam/sort.c: Get rid of MIN_SORT_MEMORY, use MIN_SORT_BUFFER instead (defined in myisamdef.h, has the same value and purpose).
This commit is contained in:
parent
7297ec560e
commit
412798658a
8 changed files with 70 additions and 33 deletions
|
|
@ -6858,7 +6858,7 @@ The minimum value for this variable is 4096.",
|
|||
"The buffer that is allocated when sorting the index when doing a REPAIR or when creating indexes with CREATE INDEX or ALTER TABLE.",
|
||||
(uchar**) &global_system_variables.myisam_sort_buff_size,
|
||||
(uchar**) &max_system_variables.myisam_sort_buff_size, 0,
|
||||
GET_ULONG, REQUIRED_ARG, 8192*1024, 4, ~0L, 0, 1, 0},
|
||||
GET_ULONG, REQUIRED_ARG, 8192 * 1024, 4096, ~0L, 0, 1, 0},
|
||||
{"myisam_use_mmap", OPT_MYISAM_USE_MMAP,
|
||||
"Use memory mapping for reading and writing MyISAM tables.",
|
||||
(uchar**) &opt_myisam_use_mmap,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue