mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Fix for bug #37756: enabling fulltext indexes with
myisam_repair_threads > 1 causes crash Problem: parallel repair (myisam_repair_threads > 1) of a myisam table with two or more fulltext keys that use the same parser may lead to a server crash. ALTER TABLE ENABLE KEYS is affected as well. Fix: properly initialize fulltext structures for parallel repair. Note: 1. there's no deterministic test case. 2. now we call parser->init() for each fulltext key (not for each fulltext parser used). storage/myisam/ft_parser.c: Fix for bug #37756: enabling fulltext indexes with myisam_repair_threads > 1 causes crash In ftparser_call_initializer() we "group" parsers and allocate parameters for each unique parser used. In case of parallel repairing we may have a bunch of parsers that use the only MI_INFO structure. Each of these parsers must have its own parameter structure in order not to interfere with others. Moreover, the allocation is done without mutex lock so parallel ftparser_call_initializer() calls are unsafe. Now we don't "group" the fulltext parsers. Parameter allocation code moved to ftparser_alloc_param() function which is called from mi_repair_parallel() as well to allocate parameters for each parser used. storage/myisam/ftdefs.h: Fix for bug #37756: enabling fulltext indexes with myisam_repair_threads > 1 causes crash ftparser_alloc_param(MI_INFO *info) added. storage/myisam/mi_check.c: Fix for bug #37756: enabling fulltext indexes with myisam_repair_threads > 1 causes crash ftparser_alloc_param(info) called in case of parallel repair to allocate fulltext parser parameters. storage/myisam/mi_open.c: Fix for bug #37756: enabling fulltext indexes with myisam_repair_threads > 1 causes crash set keyinfo->ftkey_nr and share->ftkeys.
This commit is contained in:
@@ -185,7 +185,7 @@ typedef struct st_mi_keydef /* Key definition with open & info */
|
||||
uint16 maxlength; /* max length of (packed) key (auto) */
|
||||
uint16 block_size_index; /* block_size (auto) */
|
||||
uint32 version; /* For concurrent read/write */
|
||||
uint32 ftparser_nr; /* distinct ftparser number */
|
||||
uint32 ftkey_nr; /* full-text index number */
|
||||
|
||||
HA_KEYSEG *seg,*end;
|
||||
struct st_mysql_ftparser *parser; /* Fulltext [pre]parser */
|
||||
|
Reference in New Issue
Block a user