From 61b2a6b08312555eb2800a27d982edc13d5f0e86 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Jun 2005 21:44:17 +0200 Subject: 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 --- myisam/ft_boolean_search.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'myisam/ft_boolean_search.c') 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; -- cgit v1.2.1