summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-06-17 21:44:17 +0200
committerunknown <jimw@mysql.com>2005-06-17 21:44:17 +0200
commit61b2a6b08312555eb2800a27d982edc13d5f0e86 (patch)
treead6efdce69deb802627c189485df5498a88a437c /myisam
parent6de6d3ad5cc34a53735b0b12ca80846d50537f62 (diff)
downloadmariadb-git-61b2a6b08312555eb2800a27d982edc13d5f0e86.tar.gz
Fix hang/crash with Boolean full-text search against an unindexed field for
which the query contained more words than we allocated space. (Bug #7858) myisam/ft_boolean_search.c: Fix calculation of max number of elements -- "words" may not have spaces between them. mysql-test/t/fulltext.test: Modify test to be specific to reported bug (fix for old bug wasn't quite enough) mysql-test/r/fulltext.result: Update results
Diffstat (limited to 'myisam')
-rw-r--r--myisam/ft_boolean_search.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c
index 62c68322595..8045ddd4657 100644
--- a/myisam/ft_boolean_search.c
+++ b/myisam/ft_boolean_search.c
@@ -398,7 +398,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
Hack: instead of init_queue, we'll use reinit queue to be able
to alloc queue with alloc_root()
*/
- res=ftb->queue.max_elements=1+query_len/(min(ft_min_word_len,2)+1);
+ res=ftb->queue.max_elements=1+query_len/2;
if (!(ftb->queue.root=
(byte **)alloc_root(&ftb->mem_root, (res+1)*sizeof(void*))))
goto err;