Skip to content

Commit

Permalink
BUG#18503734 - SEGV IN RBT_SEARCH(), FTS
Browse files Browse the repository at this point in the history
1. Check whether cached_stopword is NULL in fts_tokenizer_word_get,
so that we can avoid segement fault. 2. Load stopwords if needed in
fts_add_doc_by_id. Note: The root cause why cached_stopword is not
initialized is still unfounded.

rb#6462 approved by Jimmy.
  • Loading branch information
Shaohua Wang committed Aug 29, 2014
1 parent b39a94e commit 3a1d06e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion storage/innobase/fts/fts0fts.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1255,7 +1255,8 @@ fts_tokenizer_word_get(
#endif

/* If it is a stopword, do not index it */
if (rbt_search(cache->stopword_info.cached_stopword,
if (cache->stopword_info.cached_stopword != NULL
&& rbt_search(cache->stopword_info.cached_stopword,
&parent, text) == 0) {

return(NULL);
Expand Down Expand Up @@ -3557,6 +3558,12 @@ fts_add_doc_by_id(

rw_lock_x_lock(&table->fts->cache->lock);

if (table->fts->cache->stopword_info.status
& STOPWORD_NOT_INIT) {
fts_load_stopword(table, NULL, NULL,
NULL, TRUE, TRUE);
}

fts_cache_add_doc(
table->fts->cache,
get_doc->index_cache,
Expand Down

0 comments on commit 3a1d06e

Please sign in to comment.