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 /include/myisam.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 'include/myisam.h')
-rw-r--r-- | include/myisam.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/myisam.h b/include/myisam.h index 16175547367..d7bfdf7191e 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -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 */ |