diff options
author | Ramil Kalimullin <ramil@mysql.com> | 2009-01-26 10:35:15 +0400 |
---|---|---|
committer | Ramil Kalimullin <ramil@mysql.com> | 2009-01-26 10:35:15 +0400 |
commit | 80fe6268f7a110abf383866fd9db3d2fbee332a8 (patch) | |
tree | 5abc1ae29b07ce3e199f41e4dfcab29a2f6a4d70 /storage/myisam/ftdefs.h | |
parent | add8e4d159c71592602dfa93dd67a3f6e3c6b130 (diff) | |
download | mariadb-git-80fe6268f7a110abf383866fd9db3d2fbee332a8.tar.gz |
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.
Diffstat (limited to 'storage/myisam/ftdefs.h')
-rw-r--r-- | storage/myisam/ftdefs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/storage/myisam/ftdefs.h b/storage/myisam/ftdefs.h index 22443807b87..ddcf1a8dc26 100644 --- a/storage/myisam/ftdefs.h +++ b/storage/myisam/ftdefs.h @@ -146,6 +146,7 @@ void ft_boolean_close_search(FT_INFO *); float ft_boolean_get_relevance(FT_INFO *); my_off_t ft_boolean_get_docid(FT_INFO *); void ft_boolean_reinit_search(FT_INFO *); +MYSQL_FTPARSER_PARAM* ftparser_alloc_param(MI_INFO *info); extern MYSQL_FTPARSER_PARAM *ftparser_call_initializer(MI_INFO *info, uint keynr, uint paramnr); |